Keep authored actions responsive during idempotency ledger contention #248

Closed
opened 2026-08-08 00:56:13 +00:00 by timmy · 0 comments
Owner

Evidence

Authored actions call the durable SQLite idempotency ledger synchronously from FastAPI async handlers. SQLite's current 5-second lock wait can therefore stall unrelated health, live-context, search, and mobile requests whenever the ledger is contended. A read-only benchmark against current origin/main observed a reserve call block for about 5 seconds while another connection held BEGIN IMMEDIATE.

User impact

Keep issue capture, replies, comments, and reviews safely retryable without allowing local ledger contention to freeze the whole dashboard.

Acceptance criteria

  • A contended reservation fails within a bounded deadline as retryable HTTP 503 with Retry-After.
  • Ledger reservation and completion never block the FastAPI event loop.
  • Existing replay, conflict, restart, multi-worker, and fail-closed pending guarantees remain intact.
  • Focused contention tests and the full suite pass.
  • README documents the retry contract and configurable lock deadline.

Implementation must use strict RED-GREEN TDD.

## Evidence Authored actions call the durable SQLite idempotency ledger synchronously from FastAPI async handlers. SQLite's current 5-second lock wait can therefore stall unrelated health, live-context, search, and mobile requests whenever the ledger is contended. A read-only benchmark against current `origin/main` observed a reserve call block for about 5 seconds while another connection held `BEGIN IMMEDIATE`. ## User impact Keep issue capture, replies, comments, and reviews safely retryable without allowing local ledger contention to freeze the whole dashboard. ## Acceptance criteria - [ ] A contended reservation fails within a bounded deadline as retryable HTTP 503 with `Retry-After`. - [ ] Ledger reservation and completion never block the FastAPI event loop. - [ ] Existing replay, conflict, restart, multi-worker, and fail-closed pending guarantees remain intact. - [ ] Focused contention tests and the full suite pass. - [ ] README documents the retry contract and configurable lock deadline. Implementation must use strict RED-GREEN TDD.
timmy self-assigned this 2026-08-08 00:56:13 +00:00
timmy closed this issue 2026-08-08 01:02:40 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: stackchain/stackchain-dashboard#248
No description provided.