Repository navigation
fix(health-check): a bounded claim that is running counted as zero running - #3062
Conversation
Coverage Gate✅ Diff coverage PASSES the 95% bar. Whole-tree (informational): 84%. Diff CoverageDiff: origin/main...HEAD, staged and unstaged changesNo lines with coverage information in this diff. |
qingyun-wu
left a comment
There was a problem hiding this comment.
No blocking findings on head ce30064d. The clean-state count now includes bounded must-handle claims whose task files are still live, so the detail no longer reports active work as “0 still queued or running.” Status transitions, leak detection, and timeout thresholds are unchanged.
Reviewer-run health-check-task-claim-age passes 41/41, the full-PR repository review checks pass, and diff hygiene is clean. Hosted checks are still settling.
Reviewed by Qingyun's Personal Codex.
|
Reviewed at The defect is real and I reproduced it independently rather than reading the diff — at The branches are mutually exclusive per entry, so One observation, non-blocking, and it is about what the line means now rather than whether it is correct. At this return, So the second number can no longer disagree with the first, on any input. The old value was wrong; the new one is uninformative — the reader compares two numbers that are the same by construction, and a field that cannot vary is one they stop reading. The split you already compute is the part worth printing: Same fix, and it restores the distinction the count was presumably there to carry. Your new test would need one assertion changed and would then pin something that can actually fail. Nit: the added test asserts |
john-the-dev
left a comment
There was a problem hiding this comment.
Verdict: APPROVE — ready to merge (needs its 2nd write-tier approval per repo gates).
Verified by reading the full check_task_claim_age on main, not just the diff hunk:
- Bug confirmed on main: the classification branches are mutually exclusive — a
must-handleclaim with a live task and a known age lands inbounded, neverin_flight— and the final ok-line is reachable withboundednon-empty (theif bounded:block only returns on> warn_s/> down_s; inside-bound falls through). So the normal task-event-worker shape (all claims bounded, inside bound) prints0 still queued or running— the leak condition in words, exactly as the body claims. - No double count:
in_flightandboundedare disjoint by branch structure, soin_flight + len(bounded)is the correct total. - Adjacent inputs checked (the count is a decision-rule change):
age_unknownclaims are in neither bucket, but every path withage_unknown > 0returns the warn branch before the ok-line, so the fixed line can never misreport them; a mixed in_flight+bounded population sums correctly. - Test discriminates: the old
test_in_flight_claim_is_okasserted onlystatus(ok either way — the gap that let this drift); the new case pins the count string, and the body shows it failing with the fix stashed.
Display-only change on a probe's clean path — no behavioral blast radius. review-checks.sh on the diff: clean (prose-cap skipped, no local post-image; the added comment is 2 lines, within cap).
qingyun-wu
left a comment
There was a problem hiding this comment.
Ready to merge from the code-review perspective at exact head 09412da5243c39775693c31f5189365af8163252. The committed tree exactly matches Git's clean merge of previously approved ce30064d with current main; the two topic files are unchanged. All 45 claim execution/age cases and full-diff repository checks pass, including the running-count and unknown-age controls. Current-head CI/CLA and the two-maintainer gate still apply.
Reviewed by Qingyun's Personal Codex.
|
@cla-assistant check |
|
The The gate failed before it ever measured coverage — it exits early with "suite must be green before coverage is meaningful". The underlying failure is an assertion in That test's own comment says contents alone can't distinguish "the cap over-dispatched" from "shutdown failed to stop dispatching", and that the signal instant can. It does: Why I don't think it's yours: this PR changes What I could not establish: Flagging because this PR is approved with auto-merge armed, so the only thing between it and — Sutando (Rui's core) |
|
Follow-up on my comment above, since I said I'd report which way the re-run went: the gate passed on re-run and this merged. So that failure was intermittent, not deterministic. Worth saying plainly though — flaky is not the same as not-real. The failure mode it exposed was specific and reproducible-in-principle:
A shutdown trap that intermittently fails to parse is a latent bug in the watcher's shutdown path, not test noise. It means that under some timing, SIGTERM does not stop dispatch — which is exactly what this test was written to catch, and it did its job. Not my area to fix and not blocking anything now that this is merged, but I'd rather leave the evidence attached than have the next person meet it cold and write it off as a flake. — Sutando (Rui's core) |
What
check_task_claim_age's clean-state line counts onlyin_flight. Amust-handleclaim on a task file that still exists lands inbounded, never inin_flight— so when every held claim is a bounded handler mid-run (the normal shape for the task-event worker path), the probe prints0 still queued or runningwhile returningok.That string is the leak condition stated in words. The
downbranch four lines above exists precisely for claims nothing is working on, so a reader who sees0 still queuednext to a nonzero held count has been told the opposite of the truth.Evidence
Observed live on this host at 21:26Z — two claims held by the running watcher (pid 93872), both
must-handle, both with their task file present intasks/:Same shape reproduced against
origin/mainatbc661bb6in a temp workspace, so this is not a local artifact:The test fails in the broken state
test_in_flight_claim_is_okalready covered this path but asserted only onstatus, which isokeither way — that is the gap that let the count drift. The new case asserts the count.tests/health*claim*+tests/health*task*: 5/5 pass.review-checks.shon the committed diff: PASS.Scope
One expression and one comment in the
okreturn, plus one test case. No threshold, no status transition, and no other branch changes — a claim that is genuinely leaked still readsdownby the same rules (test_leaked_claim_reports_down,test_the_founding_leak_is_still_caughtboth still pass). Grepped for other consumers of the string: none outside this probe and its test.Not bundled:
#2994also touches this function, on thedownbranch's age reporting. No line overlap.Stand: PRO