fleetd #615: write FAILED instead of leaving status(token) stuck at IN_PROGRESS #617
Reference in New Issue
Block a user
Delete Branch "worker/fleetd-615-e05481-5"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes fleetd #615.
LeadRollover.runRollovermade two unwrappedagents.sendcalls (/clearand the bootstrap text).HerdrExceptionis unchecked, and the productioncontinuationRunneris a bare virtual thread with no uncaught-exception handler, so a throw from either call killed the continuation silently.confirm()had already writtenIN_PROGRESSintooutcomesbefore scheduling the continuation, and nothing ever overwrote that entry with a terminal state — sostatus(token)reportedIN_PROGRESSforever.Fix: wrap the whole continuation body in one
try { } catch (RuntimeException e) { }, matching the local convention already used aroundagents.statusinwaitUntilAtTurnBoundary. On a throw, write a new terminalRollState.FAILEDentry naming the exception, in the same diagnostic style asTURN_NEVER_SETTLEDandCLEAR_NEVER_SETTLED.Tests: two new tests make
send()throw on the/clearcall and on the bootstrap-text call respectively (after/clearalready succeeded and settled), each assertingstatus(token)reportsFAILED, notIN_PROGRESS. Existing tests already cover the negative control (ROLLED,TURN_NEVER_SETTLED,CLEAR_NEVER_SETTLED) and still pass.Red/green proof: reverting only the production catch (keeping the tests) makes both new tests fail — the exception now propagates out of
confirm()itself, since the test harness runs the continuation synchronously. Restoring the catch turns them green again.mvn clean installinfleetd/: Tests run: 1866, Failures: 0, Errors: 0, Skipped: 0 — BUILD SUCCESS.Sweep (report only, not fixed here):
LeadRolloverhas exactly onecontinuationRunner.acceptcall site (inconfirm()) and exactly one place that writes a non-terminalIN_PROGRESSentry before handing off to it — both already covered by this fix. The twoagents.statuscalls (waitUntilAtTurnBoundary,waitForClearPickupAndSettle) and the oneagents.submitcall (waitForClearPickupAndSettle) already have their own localtry/catch(RuntimeException)around them, predating this change. No other unwrappedagents.*call or non-terminal-state-before-handoff pattern exists in this class.