WS-C1 Graceful shutdown: signal -> serve_with_shutdown -> drain -> db.close() WAL checkpoint #289

Closed
opened 2026-07-31 18:14:11 +00:00 by KofTwentyTwo · 1 comment
KofTwentyTwo commented 2026-07-31 18:14:11 +00:00 (Migrated from github.com)

Single CancellationToken owned by main.rs; bounded grace; the WAL-checkpointing db.close() (never called in prod today -> corruption risk on every OS kill). Ship first so all workers are cancel-aware. Size M.

Roadmap-to-9/10 (design: scratchpad/design/). Serial PROTO queue via WS-A. Brief at dispatch. DoD per docs/STORY-WORKFLOW.md.

Single CancellationToken owned by main.rs; bounded grace; the WAL-checkpointing db.close() (never called in prod today -> corruption risk on every OS kill). Ship first so all workers are cancel-aware. Size M. Roadmap-to-9/10 (design: scratchpad/design/). Serial PROTO queue via WS-A. Brief at dispatch. DoD per docs/STORY-WORKFLOW.md.
KofTwentyTwo commented 2026-07-31 18:55:20 +00:00 (Migrated from github.com)

Delivered via PR #340 (WS-C1, squash-merged to dev). Graceful shutdown: watch-based ShutdownSignal (no new dep) + Ctrl+C/SIGTERM handlers; gRPC via serve_with_shutdown (existing serve delegates -> no test churn); sync/outbox/update workers rewritten as cancel-safe select!; bounded 10s grace then an unconditional db.close() (forces the WAL checkpoint that was never run in prod -> closes the corruption-on-kill risk). 2 tests prove server-stops + worker-exits + db.close runs. Lifecycle foundation for the rest of WS-C.

Delivered via PR #340 (WS-C1, squash-merged to dev). Graceful shutdown: watch-based ShutdownSignal (no new dep) + Ctrl+C/SIGTERM handlers; gRPC via serve_with_shutdown (existing serve delegates -> no test churn); sync/outbox/update workers rewritten as cancel-safe select!; bounded 10s grace then an unconditional db.close() (forces the WAL checkpoint that was never run in prod -> closes the corruption-on-kill risk). 2 tests prove server-stops + worker-exits + db.close runs. Lifecycle foundation for the rest of WS-C.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: KofTwentyTwo/nuncio#289