Skip to content

fix: drained turns before runtime handover - #229

Merged
jacobcxdev merged 2 commits into
mainfrom
jacobcxdev/fix/turn-boundary-handover
Oct 10, 2026
Merged

jacobcxdev merged 2 commits into
mainfrom
jacobcxdev/fix/turn-boundary-handover

Conversation

@jacobcxdev

@jacobcxdev jacobcxdev commented Oct 10, 2026 •

Copy link
Copy Markdown
Owner

Busy chats previously kept renewing work before the upgrade controller reached its drain command, so deployment could defer indefinitely. Upgrades now pause new admissions first and let each dispatched turn finish. Completed WebSocket chats receive 1012 and reconnect; new connections queue while remaining turns drain and the verified successor takes ownership.

  • Removed the default drain deadline while keeping explicit bounded requests and preparation/recovery limits.
  • Kept CLI reconciliation waiting for a known active transaction; prepared-only or unreadable receipts still report unverified selection. Authenticated bounded status probes detect a stopped controller behind a stale waiting receipt while paused-listener timeouts remain pending.
  • Reconciled a verified unchanged runtime without another handoff, preserving truthful receipts and rollback artifacts.
  • Added overlapping-turn, continuous-traffic, queued-request and failure-path regression coverage.

Validation: go build ./..., go vet ./..., and go test -race -count=1 ./... passed. Focused final CLI race tests passed. Native Homebrew acceptance at final head c9bf4fa passed: all 163 admitted turns completed, HTTP 200=148, WebSocket 101=14, zero 503, refused connections or continuity mismatches, one coordinator owner and the same listener/PID. Production state stayed unchanged.

The already-running v0.34.2 controller still needs its existing initial quiet boundary to load this fix. Subsequent handovers use the new drain ordering.

- Paused new admissions before waiting for current turns to finish.
- Reconnected completed chats without replaying dispatched work.
- Kept verified upgrades waiting through long drains and reconciled unchanged runtimes safely.
- Added overlapping traffic and failure-path regression coverage.
@jacobcxdev jacobcxdev self-assigned this Oct 10, 2026
- Checked authenticated runtime status after long drains exceeded discovery time.
- Reported explicit controller failures without timing out healthy paused listeners.
- Covered authentication, transaction binding, transient errors and unchanged submission requests.
@jacobcxdev
jacobcxdev merged commit 3b7a0be into main Oct 10, 2026
1 check passed
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.

1 participant