Skip to content

fix(server): set WAL mode and busy timeout on runtime sqlite - #7656

Open
sentry[bot] wants to merge 2 commits into
devfrom
seer/fix-desktop-app-7e-runtime-sqlite-locked
Open

sentry[bot] wants to merge 2 commits into
devfrom
seer/fix-desktop-app-7e-runtime-sqlite-locked

Conversation

@sentry

@sentry sentry Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

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/health is one example.

What problem does it solve?

Concurrent reads on runtime.sqlite failed with Error: database is locked during 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?

Before After
Journal mode Rollback (default) WAL
Wait on conflict (busy_timeout) 0 ms, fails immediately 5000 ms, waits for the lock
Read during a write Throws database is locked Waits, then succeeds

How is this implemented?

  • apps/server/src/runtime-db.ts: openRuntimeSqliteDatabase sets PRAGMA busy_timeout = 5000 and PRAGMA journal_mode = WAL.
  • workspace-kv-store.ts (getExisting) and runtime-opencode-config-store.ts (listRuntimeOpencodeConfigRows, inspectRuntimeOpencodeConfigState): read-only connections now set busy_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 run

This PR was automatically generated by Sentry at no cost. You can adjust this setting at any time.

@vercel

vercel Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

3 Skipped Deployments
Project Deployment Actions Updated
openwork-app Skipped Skipped Nov 21, 2026 11:01am UTC
openwork-den Skipped Skipped Nov 21, 2026 11:01am UTC
openwork-landing Skipped Skipped Nov 21, 2026 11:01am UTC

Request Review

@vercel
vercel Bot temporarily deployed to Preview – openwork-den November 21, 2026 10:58 Inactive
@vercel
vercel Bot temporarily deployed to Preview – openwork-app November 21, 2026 10:58 Inactive
@vercel
vercel Bot temporarily deployed to Preview – openwork-landing November 21, 2026 10:58 Inactive
@vercel
vercel Bot temporarily deployed to Preview – openwork-app November 21, 2026 11:01 Inactive
@vercel
vercel Bot temporarily deployed to Preview – openwork-den November 21, 2026 11:01 Inactive
@vercel
vercel Bot temporarily deployed to Preview – openwork-landing November 21, 2026 11:01 Inactive

This branch was previously deployed

3 inactive deployments
Preview – openwork-landing — 68ccce7b Deployed Nov 21, 2026 by vercel[bot]
Preview – openwork-app — 68ccce7b Deployed Nov 21, 2026 by vercel[bot]
Preview – openwork-den — 68ccce7b Deployed Nov 21, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants