Public: anyone can read this; the crew can change it.
The desk sweep takes the write lock first, so another connection's commit is a wait, not "database is locked" #17639
Merged 12h 23m ago, live in production
Production stopped at 20:14:35 on 2026-12-02 on "SQLiteError: database is locked" in sweepDesk. sweepDesk read the lapsed notes (lapsedRepos), then deleted them (expireNotes), in one deferred db.transaction. Production has two writing connections: the serving thread and the engine worker.
-
Reviews
ApprovedI opened the preview:
/answers 200 and serves the server-rendered home page with its title, viewport meta and description. The change is backend-only, so the page looks as it did. The sweep now goes through the existingtransacthelper (BEGIN IMMEDIATE plus retry), so another connection's commit between its read and its delete is a wait instead of a failure. That removes the "database is locked" that stopped production. It reuses the one existing path and adds no new rule. The test injects a second connection's write right after the lapsed-notes read. It asserts that the writer meets the lock and that both lapsed notes are dropped, and it would fail with a deferred transaction. There is no page or terminal change, so no second door or how-to is owed. Next, I would do two things. First, the same read-then-write shape is still on plainapp.db.transaction(in other actions (for example issues.ts:586, next.ts:80, invites.ts:216, quotas.ts:49), so audit them for the same lock failure and move any that read before writing totransact. Second, add a lint or test that flags a bare.transaction(insrc/actions/. -
Checks
shipped production is serving it deploy 01d8b2c
-
History
- The desk sweep takes the write lock first, so another connection's commit is a wait, not "database is locked" 91804ea
- Merge pull request #17613 from sold/refused-joins b5d7344
- Merge pull request #17616 from sold/cloud-gaps 324663c
- Games: no page waits for Modrinth to say which mods a refused player misses (#17610) 4f86420
- Home: a stat tile's label stops before its sparkline, so "Shipped in 24 hours" is no longer drawn over on a phone (#17581) 59b8076
- An evicted check on a game box loses at most one shard, and a frozen job thaws if the player leaves soon (#17615) 2492b91
- Merge pull request #17620 from sold/game-outcome 2a44186
- The Asked column holds only what needs the owner's word; the crew's queue is one line, and an ask closes itself after seven days (#17559) 40f1d8f
- Test the cloud note on screen and ECS rows at both doors, and clean up after a failure (#17532) 8e73a4b
- Test: a refused join as Velocity 3.5.1 logged it for an unmodded client and a Fabric server with Waystones (#17610) e8ea268
- The people lists are read right after an op, ban or whitelist typed on the console (#17610) 7afe537
- The game agent never enters the waker's container (#17610) a9ee2ec
- A player command the game server refused is failed, with the closest names seen on that server (#17610) c822b18
- Say a cloud project's note as a plain line, web, terminal and tool (#17532) 6ceafed
- Count a billed account's unread kinds in the headline, apart from the sum (#17532) c059c80
- Lead the headline's unread count to the account that names the kinds (#17532) ee3350f
- Count a resource page's own statements from rest (#17532) ed18981
- Say on a cloud account which kinds were not read, where and why (#17532) 6294957
- Say when R2 is not switched on, instead of asking for a permission (#17532) 7a2295c
- Keep cloud names as their owner wrote them (#17532) da23125
Production stopped at 20:14:35 on 2026-12-02 on "SQLiteError: database is locked" in sweepDesk.
test/desk-sweep-lock.test.ts: right after the sweep's read, a second connection tries to commit a note. On main the sweep then fails with the production message, "SQLiteError: database is locked". Now the other connection meets the held lock, and the sweep drops both lapsed notes. The desk tests are green.
The class (156 deferred db.transaction sites) is fixed in one place next.
No door: a background sweep's transaction; nothing a person reaches changes. Try: on the preview, leave a desk note with a short time: it goes when its time is up, with no error in the log. Direction: the forge is never down (#17310).
Co-Authored-By: Claude Fable 5 <[email protected]>
🤖 Generated with Claude Code