Repository navigation
[WIP] Diagnose graceful restart drain behavior before next release - #78
aryanorastar with Copilot wants to merge 4 commits into
Conversation
8010193 to
404c2b4
Compare
Co-authored-by: aryanorastar <106255197+aryanorastar@users.noreply.github.com>
Adds privacy-safe (internal message keys only) per-case drain logging so a restart window distinguishes: completed during drain, returned unstarted, left for reclaim with delivery not started, and left for reclaim with uncertain delivery. Closes the issue-#66 evidence gap where a bounded log window could not prove which outcome an in-flight request took. Co-authored-by: aryanorastar <106255197+aryanorastar@users.noreply.github.com>
Adds a RUNBOOK section listing the per-case shutdown log lines that prove each drain outcome and the human-run redeploy smoke steps, plus an honest ROADMAP entry: code implemented and tests passed, rollout pending. Co-authored-by: aryanorastar <106255197+aryanorastar@users.noreply.github.com>
404c2b4 to
5fdeb03
Compare
Integration update — rebased onto current main
|
aryanorastar
left a comment
There was a problem hiding this comment.
Independent source review at5fdeb031: not merge-ready. (1) drain snapshots jobs before awaiting accepted tasks, so an already-accepted request whose database claim resolves during drain can be absent from the timeout deferral set. A synthetic delayed-claim probe ends queued on main but processing on this branch. (2) a rejected defer logs failure, then the next loop still logs returned-success based on !job.lost; a probe confirmed the row remains processing. Only confirmed outcomes may be logged; stale/zero-row owner updates also cannot establish requeue. (3) the runbook must not guarantee a later answer after deferral/database uncertainty or infer platform termination solely from missing logs. Require independent termination evidence. Repair in this same draft with deterministic delayed-claim/defer-failure/unknown-outcome tests and replace20/50ms setup sleeps with gates. The accepted controlled Redeploy smoke and closure of #66 remain valid; optional per-case diagnostics are not a renewed release gate. Review used source and tiny synthetic probes only, no production/customer/protected input or provider calls.
… runbook Co-authored-by: aryanorastar <106255197+aryanorastar@users.noreply.github.com>
Addressed all three findings in (1) Late-claim gap — (2) Unconfirmed (3) Runbook certainty — the section no longer guarantees a later answer after deferral/DB uncertainty (recovery is described as the expected path to verify, not a promise) and no longer concludes platform termination from missing logs alone; it now requires independent termination evidence (deployment/instance state), noting bounded-window/scraping gaps as alternative causes. Tests: replaced the 20/50ms setup sleeps with deterministic barriers. Added three red-before tests — delayed-claim tracking, defer-returns-false, defer-throws — all three FAIL on the pre-fix head |
|
Closing as requested by the reviewer: #66’s goal was met by the controlled Redeploy smoke using existing logs. Per-case drain outcome logging, if needed, is retained under #51; the newer diagnostic work at 2458e9d is preserved on this branch, not merged or claimed deployed. The branch will not be deleted. The smoke proves clean drain for the observed scenario, not a universal exactly-once guarantee. |
Cause named: no application defect found in code — drain already finishes started work within budget, returns unstarted work at timeout instead of leaving it abandoned, and never replays delivery-started work. The branch adds the missing per-case evidence. The live platform question (whether the old process had time to log during the manual Restart) is what the human-run redeploy smoke checks, per the new RUNBOOK section.