Drain authored mutations before shutdown #461

Closed
opened 2026-08-10 07:09:31 +00:00 by timmy · 0 comments
Owner

Problem

Controlled restarts close the shared Gitea transport while shielded authored mutations (comments, replies, reviews, and issue actions) may still be completing. This can orphan an idempotency reservation even though graceful shutdown had an opportunity to preserve the result.

Scope

Add a bounded graceful-shutdown drain for in-flight authored mutation tasks before transport closure. Completed operations must persist their ledger result; stalled operations must not hang shutdown indefinitely.

Acceptance criteria

  • Shutdown waits for a live authored mutation and closes transport only after its result is persisted.
  • The persisted response is replayable after ledger reconstruction with exactly one upstream mutation.
  • A stalled operation is cancelled and settled when the configured grace period expires.
  • Existing snapshot shutdown and authored-idempotency behavior remain green.
  • The grace period is configurable and documented.

Non-duplication evidence

Historical issue and commit search found no authored-task shutdown drain. #201/#202 persist idempotency across restarts and #319/#320 classify already orphaned reservations; this issue prevents a graceful restart from creating avoidable orphaned reservations.

## Problem Controlled restarts close the shared Gitea transport while shielded authored mutations (comments, replies, reviews, and issue actions) may still be completing. This can orphan an idempotency reservation even though graceful shutdown had an opportunity to preserve the result. ## Scope Add a bounded graceful-shutdown drain for in-flight authored mutation tasks before transport closure. Completed operations must persist their ledger result; stalled operations must not hang shutdown indefinitely. ## Acceptance criteria - Shutdown waits for a live authored mutation and closes transport only after its result is persisted. - The persisted response is replayable after ledger reconstruction with exactly one upstream mutation. - A stalled operation is cancelled and settled when the configured grace period expires. - Existing snapshot shutdown and authored-idempotency behavior remain green. - The grace period is configurable and documented. ## Non-duplication evidence Historical issue and commit search found no authored-task shutdown drain. #201/#202 persist idempotency across restarts and #319/#320 classify already orphaned reservations; this issue prevents a graceful restart from creating avoidable orphaned reservations.
timmy self-assigned this 2026-08-10 07:09:31 +00:00
timmy closed this issue 2026-08-10 07:14:29 +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#461
No description provided.