fix(opencode): raise SQLite busy_timeout to 10s#29107
Open
divitkashyap wants to merge 1 commit into
Open
Conversation
The 5000ms default still trips SQLITE_BUSY on busy DBs (see issue anomalyco#21215 for a +5015ms log). Bump to 10000ms so concurrent `opencode run` workers and multi-FD TUI sessions wait through longer WAL holds instead of failing the in-flight write. Closes anomalyco#21215 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Author
|
@thdxr — this touches the same pragma block you added in #10597. Happy to adjust the value or drop this in favor of retry logic if you'd rather tackle the underlying lock-hold-duration issue raised in the latest #21215 comment (writes serializing for 5s+ during large bash-tool output). Just figured a one-line bump was worth shipping while the sharding PR (#21579) cooks. |
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 #21215
Type of change
What does this PR do?
Bumps
PRAGMA busy_timeouton the mainopencode.dbconnection from 5000ms to 10000ms.The 5s value was added in #10597 and helped, but issue #21215 includes a fresh log line
error=database is locked ... +5015msshowing the writer is still blowing past the 5s window on busy DBs (1.3GB file, 11 FDs from one TUI, parallelopencode runworkers). Doubling the wait lets SQLite ride out the longer WAL holds instead of surfacingSQLITE_BUSYinto the session processor, which currently halts the in-flight turn with no retry.One-line change. Not a substitute for the per-session sharding work in #20935/#21579, just buys headroom in the meantime.
How did you verify your code works?
bun turbo typecheckpasses (run by the pre-push hook, 15/15 packages green)busy_timeoutso the OS-level retry loop covers contention windows)packages/opencode/test/storage/suite has no precedent for asserting runtime PRAGMA values on the liveClient(), and a contention repro is a multi-process integration test outside the scope of this minimal changeChecklist