fleetd #512 follow-up: record why the drain-complete line must not move into a finally #547
Reference in New Issue
Block a user
Delete Branch "fix/512-drain-line-non-goal"
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?
Comment only. No behaviour change.
SessionManager.drainAll's javadoc.Why
drainAll's existing javadoc says thelog.info"is a positive assertion that the drain actuallyfinished, on the normal path, every time". That wording reads as an invitation to the one edit
that destroys what it is describing: moving the line into a
finally, or wrapping the method inone.
In a
finallythe line prints after a drain that threw, carrying whatever partialtallyithad reached. That loses the absence signal and gains a confident wrong number in the same change.
Both halves of the value go at once.
The code is already correct —
drainAllhas notry/finallyand thelog.infois the laststatement of the successful path. Nothing here changes that. What was missing is the sentence that
stops a reviewer undoing it.
Where it came from
Raised by the fleet01 lead on 2026-09-12, from their 2026-09-10 incident on their host:
The loud variant is the one we have seen. The quiet variants are what this line exists to catch, and
they are only detectable by the line's absence.
Their second, smaller point is also recorded:
releasedandabandonedare counted incrementallyinside
drainSnapshot's loop and folded withDrainTally.plus, not derived from a collection readat the end. If a partial report is ever wanted it must be a different line with a different verb.
One line must not serve both, or the wording cannot tell a finished drain from an interrupted one.
I verified both properties in the code before writing the comment: no
try/finallyindrainAll,and
released++/abandoned++insidedrainSnapshot's per-session loop.Verification
Built in a scratch worktree, not in the main clone — a
mvn installthere would overwrite the jarthe live daemon is running on, which is #413's failure mode.
mvn -B clean install: exit 0,Tests run: 1716, Failures: 0, Errors: 0, Skipped: 0,BUILD SUCCESS. Same count asmain, as expected for a comment-only change.mvn -B -DskipTests javadoc:javadoc -Ddoclint=reference): exit0, 0 reference errors. The new
{@link DrainTally#plus}resolves.Reporting the exit code next to every count deliberately: a build that dies before running anything
prints no
Tests runline at all, and grepping for failures then finds none.