Repository navigation
[CTX-1187] fix(winjob): harden gone-process resume assertion with bounded drain - #2051
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 29 minutes. View limit details
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
Xuepoo
left a comment
There was a problem hiding this comment.
Independent review verdict — PR #2051 ([CTX-1187] fix(winjob): harden gone-process resume assertion with bounded drain).
Reviewer: independent agent (guard-dispatched, separate session). Reviewed head: 5b68f3887c7dc1cda4030f49c9b4e49e5602250b (task CTX-1187, issue #2030).
VERDICT: LGTM
Checks run (read-only, 3 tool calls):
git show 5b68f388 --stat→ 1 file,crates/bitty-winjob/src/job.rs(+42 / −2).git show 5b68f388 -- crates/bitty-winjob/src/job.rs→ bounded drain loop.- PR review-thread query → zero prior review comments.
Findings: none blocking. The bounded drain loop is sound — only io::ErrorKind::NotFound counts as gone, any other error or spurious Ok retries, POLL = 10ms between probes (no busy-wait), fail-closed with a rich diagnostic at the ceiling GONE_RESUME_ATTEMPTS = 200 (≈2s, far below the 20s WAIT_BOUND). Arithmetic is panic-free (saturating_add / Duration::saturating_mul). The durable assertion is preserved (resume settles to NotFound + trailing !process_is_running(pid)); the open child handle fences the pid against recycling. Non-blocking notes: a spurious Ok now retries rather than failing directly (intended tradeoff), and ok_polls is diagnostic-only.
Limitation: the test is Windows-only (#[cfg(test)] + std::os::windows), so no execution evidence exists on this Linux host — CI green (Windows check and test passed on run 38483875624) is the execution gate.
All required checks green at head 5b68f388: Quality gates (1)(2), MSRV 1.85, Linux X11 (xvfb), Linux Wayland, macOS ARM64, Windows check and test, Supply chain, Analyze (actions/rust), CodeQL, M1 matrix (Tier 1 aggregate), Compat release matrix (Tier 1 aggregate), VM tier (PR).
5b68f38 to
917e97e
Compare
|
Rebase note (guard): branch rebased onto |
Resumes of a terminated suspended child can spuriously succeed when the Windows thread snapshot still lists the dead pid just after reap, flaking resuming_a_gone_process_fails (3x tracked).
Change: replace the single resume assert with a bounded drain loop (200 x 10ms via saturating math, about 2s ceiling). Only ErrorKind NotFound counts as gone; Ok or any other error retries until the ceiling, then fails closed with pid, attempts, ok polls, and last error kind. The Child handle stays alive across probes so the pid cannot be recycled (generation fencing). Reap now expects success instead of ignoring the result. No production change; assertion is tightened, never weakened to always-pass.
Evidence (Linux host, Windows-only test compiles to empty surface):
Windows re-verification still needed: this host cannot execute the winjob suite; remote Windows CI on this PR is the real proof.
Priority: P2 | Area: stability | Labels: fix,P2,area:stability | Milestone: v0.1.0 | Task: CTX-1187
Related #2030
Summary by CodeRabbit