Skip to content

fix(server): enable WAL mode and busy timeout on runtime sqlite database - #6481

Open
sentry[bot] wants to merge 1 commit into
devfrom
seer/fix/runtime-db-wal-mode
Open

sentry[bot] wants to merge 1 commit into
devfrom
seer/fix/runtime-db-wal-mode

Conversation

@sentry

@sentry sentry Bot commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

What is this about?

Fixing "database is locked" errors in OpenWork's local runtime database.

What problem does it solve?

Several parts of the app can use the same database file at once, and they sometimes block each other. When that happens, reads fail with "database is locked" (Sentry DESKTOP-APP-4N).

What was the situation before?

Multiple modules each keep their own connection to the same runtime.sqlite file. The database used SQLite's default rollback journal mode. While one connection was writing, it held an exclusive lock that also blocked other connections from reading.

How is this implemented?

  • openRuntimeSqliteDatabase() now sets PRAGMA journal_mode=WAL right after opening the database, so readers and writers can work at the same time. This applies to both the Bun and Node:sqlite paths.
  • It also sets PRAGMA busy_timeout=5000 on both paths, so a briefly locked database is retried for up to 5 seconds instead of failing immediately.

What else changed?

none

Release note

Fixed intermittent "database is locked" errors when OpenWork reads and writes its local runtime data.

Evidence

  • pnpm typecheck: passes with zero errors.
  • node --test apps/server/test/node-runtime.test.mjs: 25/25 tests pass.

Fixes DESKTOP-APP-4N

@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 Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

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

4 Skipped Deployments
Project Deployment Actions Updated
openwork-app Skipped Skipped Oct 25, 2026 11:00am UTC
openwork-den Skipped Skipped Oct 25, 2026 11:00am UTC
openwork-diagnostics Skipped Skipped Oct 25, 2026 11:00am UTC
openwork-landing Skipped Skipped v0 Oct 25, 2026 11:00am UTC

Request Review

@vercel
vercel Bot temporarily deployed to Preview – openwork-diagnostics October 25, 2026 11:00 Inactive
@vercel
vercel Bot temporarily deployed to Preview – openwork-landing October 25, 2026 11:00 Inactive
@vercel
vercel Bot temporarily deployed to Preview – openwork-den October 25, 2026 11:00 Inactive
@vercel
vercel Bot temporarily deployed to Preview – openwork-app October 25, 2026 11:00 Inactive
@github-actions

github-actions Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

OpenWork evidence

Status Commit Preview Updated
🟡 Updating evidence e1dbbd8 View run 2026-10-25 11:01:31 UTC

A preview for this commit is being prepared.

@diff-warden diff-warden Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warden clearance. Complete security and confidentiality review of e1dbbd849a26a77d6a6c840c60001128bfee42ea found no high or medium security findings and no confidentiality findings. Any new push dismisses this approval. Analysis run

@diff-warden

diff-warden Bot commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

Warden: approved

No high or medium security findings and no confidentiality findings.

Reviewed e1dbbd849a26 · Warden run · Updates after every Warden run.

This branch is waiting to be deployed

4 inactive and 1 waiting deployments
Preview – openwork-app — e1dbbd84 Deployed Oct 25, 2026 by vercel[bot]
Preview – openwork-diagnostics — e1dbbd84 Deployed Oct 25, 2026 by vercel[bot]
Preview – openwork-landing — e1dbbd84 Deployed Oct 25, 2026 by vercel[bot]
Preview – openwork-den — e1dbbd84 Deployed Oct 25, 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