Repository navigation
fix(bin): retry transient contribution observation failures before waking - #7944
Vela3202019 wants to merge 1 commit into
Conversation
[Medium impact] The current two-file change appears safe to merge. Reviews (5) · Last reviewed commit: "fix(bin): retry a failed contribution ob..." · Reviewed by Greptile |
f68886a to
da7587b
Compare
|
Speaking as Kun's firstmate: thank you @Vela3202019 for carrying this over from #6668 and bringing it onto current main. What I checked (head
No-mistakes binds Contract-class (my own read): new-default. This is the same call as on #6668. These are good fixes for false wakes, but every unconfigured home would behave differently: a background beat runs during watcher startup, the startup lock order changes, and a failed contributions read gets an extra retry. That makes it the captain's call, not an auto-merge. VISION: One captain aligns (fewer false "observation unavailable" and stale-watcher wakes; a persistent failure still wakes once). Authority aligns (no new grant). Scripts aligns (bounded, deterministic mechanics). Restart aligns (a wedged startup still goes stale and keeps its stale-lock evidence). Delegation aligns. Vendor is neutral. Scope aligns. Status: waiting on the quick CI checks I just approved, which is on our side. After that, we run the full suite (the "Full suite" check needs a maintainer label for outside PRs, so a failure there now isn't on you). If it's green, this goes to the captain as a merge-or-leave decision. #6668 can stay open for now. Once one of the two lands, we'll close the other with thanks. |
|
CI is green on lint, coverage, repo invariants and the no-mistakes check. The full suite is waiting for the full-ci label. This replaces #6668. Could a maintainer add it when convenient? Thanks! |
|
Speaking as Kun's firstmate: thanks @Vela3202019. We ran the full suite on head Behavior portable serial 6, from this change. After that the lane hung until the job was cancelled about 13 minutes later. My read of the cause: the test SIGSTOPs the watcher just after Behavior portable parallel 1, not yours. Next step is with you: a fix for the serial 6 lane, pushed through |
da7587b to
7ece32e
Compare
|
Speaking as Kun's firstmate: thanks @Vela3202019 for the quick turnaround on the frozen-watcher problem. I read the new head Your push re-ran CI on its own with the |
|
Speaking as Kun's firstmate: thanks @Vela3202019. The full suite on head Every gate is green, so this is now with the captain for the merge decision. It is not waiting on you. The reason it needs the captain: it changes watcher startup and forge-read retry behaviour for every unconfigured home (new-default, the same call as #6668). |
A forge observation that fails is retried once while the budget still covers a full observation reserve, so a transient failure or a head that moved mid-read costs one extra read instead of a false unavailable wake. A URL whose failure episode is already open is not retried, and a retry the budget refuses keeps the first genuine failure. Drops the startup-beacon half of the original change: upstream kunchenguid#8025 already bounds the watcher startup locks, publishes the lock identity early, and makes the arm wait for the identity, so that half is superseded.
7ece32e to
9096e97
Compare
Intent
This PR is the replacement for #6668, carried onto current main, now scoped to the contributions retry fix:
bin/fm-contributions.shretries a failed forge observation once while the budget still covers a full observation reserve, so a transient forge failure or a head that moved mid-read no longer raises a false unavailable wake. The startup-beat half of the original change is dropped because upstream's #8025 already covers it.What Changed
Replaces #6668, which could not be updated in place after upstream moved.
bin/fm-contributions.sh: when a contribution observation fails and no failure episode is already open, retry it once while the budget still covers a full observation reserve, so a transient forge failure or a head that moved mid-read no longer produces a false unavailable wake.tests/fm-contributions.test.shwith fixtures and assertions for transient retry, persistent failure, budget-cutoff, and open-episode paths, and update existing read-count and test-name expectations to match the observation-level retry.Risk Assessment
✅ Low: The change is a well-bounded, single-purpose retry with budget and episode gating, backed by thorough behavioral tests; the only issues found are a minor header-comment inaccuracy and a misleading test-fixture label, neither of which affects runtime correctness.
Testing
Ran the focused contributions test file (75 assertions, all green) and then live-drove the actual bin/fm-contributions.sh poll command against a disposable forge fixture across six scenarios: transient retry, killed-read recovery, head-moved recovery, persistent wake, budget-cutoff, and open-episode. An A/B run against the base commit confirmed the change eliminates the false wakes from killed forge reads and mid-read head moves (base woke with exit-137 and 'head changed during observation'; target retries once and emits no wake) while genuine failures still wake once and persist their error.
Evidence: A/B regression proof: base wakes, target stays silent
Source: A/B regression proof: base wakes, target stays silent
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
bin/fm-contributions.sh:87- The new observation-level retry (lines 84-92) retries every failed observation once before waking, including a 404, but the header paragraph above it still states at line 75 that "Other failures are reported immediately, including a 404, which is how a lost login reads on a private repository." These two statements now contradict: a 404 is no longer reported immediately; it is retried once at the observation level before the unavailable line prints. The renamed test test_http_404_is_not_forge_retried (tests/fm-contributions.test.sh:985, now asserting 2 core reads for a 404) confirms the new behavior. Update the lines 73-76 wording so the read-level retry boundary (transient errors only, no 404 retry inside forge()) is described separately from the new observation-level retry, keeping the header accurate.tests/fm-contributions.test.sh:876- The retry-once (line 876) and fail-persist (line 885) fault handlers emit a bare 'HTTP 502' (no 'gh: ' prefix and no '(HTTP NNN)' parentheses). bin/fm-contributions.sh's forge_http_status does not match that bare form, so forge_error_summary classifies it as 'request failed' and forge_transient_error treats it as non-transient. Consequently test_transient_forge_failure_retries_once (line 1639) does not actually exercise a transient forge failure: the single retry it observes is the new observation-level retry of a non-transient (unclassifiable) failure, not forge()'s internal transient retry. The tests pass and the new observation-retry path is genuinely covered, so this is informational, but the name and the 'HTTP 502' text misrepresent what is exercised; a future reader expecting a transient 5xx to produce 4 core reads (forge retry x observation retry) will be misled.✅ **Test** - passed
✅ No issues found.
bash tests/fm-contributions.test.sh(full focused suite: 75 ok, 0 not ok, bounded by a background kill watchdog)bash drive-poll-retry.sh(live-drove the realbin/fm-contributions.sh pollacross six scenarios against a disposable forge fixture)bash ab-false-wake.sh <basebin>(A/B: base commit vs target commit on killed-read and head-moved false wakes)✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.