Repository navigation
fix(server): set WAL mode and busy timeout on runtime sqlite - #7656
Open
sentry[bot] wants to merge 2 commits into
Open
sentry[bot] wants to merge 2 commits into
sentry[bot] wants to merge 2 commits into
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub. 3 Skipped Deployments
|
This branch was previously deployed
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.
What is this about?
Reads from the runtime database can fail when another connection is writing at the same time. The health check at
GET /workspace/:id/mcp/openwork-cloud/healthis one example.What problem does it solve?
Concurrent reads on
runtime.sqlitefailed withError: database is lockedduring any write from another connection. This change lets reads wait for a write to finish instead of failing right away.What was the situation before?
busy_timeout)database is lockedHow is this implemented?
apps/server/src/runtime-db.ts:openRuntimeSqliteDatabasesetsPRAGMA busy_timeout = 5000andPRAGMA journal_mode = WAL.workspace-kv-store.ts(getExisting) andruntime-opencode-config-store.ts(listRuntimeOpencodeConfigRows,inspectRuntimeOpencodeConfigState): read-only connections now setbusy_timeout.apps/server/test/workspace-kv-store.test.ts: regression test that an open write transaction on another connection does not block readers.What else changed?
none
Release note
Fixes an intermittent "database is locked" error when the app reads its local data while it is being written.
Fixes DESKTOP-APP-7E
@sentry <feedback>: Autofix iterates on these changes@sentry stop iterating: Autofix stops iterating on this runThis PR was automatically generated by Sentry at no cost. You can adjust this setting at any time.