fix(core): retry locked SQLite statements cooperatively - #42539
Open
cms19859230182-lang wants to merge 1 commit into
Open
fix(core): retry locked SQLite statements cooperatively#42539cms19859230182-lang wants to merge 1 commit into
cms19859230182-lang wants to merge 1 commit into
Conversation
Contributor
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
cms19859230182-lang
force-pushed
the
interrupt-latency
branch
from
August 14, 2026 08:51
d111881 to
1600a2f
Compare
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
Closes #42120
Type of change
What does this PR do?
Interrupted turns can take ~11s to settle because locked SQLite statements spin in the native busy handler (
busy_timeout = 5000), freezing the event loop while the interrupted step waits for the shared transaction permit inside its settlement mask.Sqlite.makeConnection(bounded ~1.6s, onlyLockTimeoutError, never re-runs a transaction).busy_timeoutis set to 0 (node driver timeout too), so waits happen in Effect fibers and the event loop stays schedulable.How did you verify your code works?
LockTimeoutError; interrupted settlement queues behind an unrelated transaction (deterministic Deferred gates, no sleeps).bun test test/session-runner.test.ts test/database-drizzle.test.tsfrompackages/core: 158 passed.bun typecheck: passed.Screenshots / recordings
Not a UI change.
Checklist