Repository navigation
fix(review): a slow janitor no longer cancels running reviews (#2667) - #2669
Conversation
Call 'janitor status --capacity' (v0.1.17+, ~50 ms vs 1-20 s at high load), falling back to plain status when an older janitor rejects the flag. When janitor does not answer and no fresh sample remains, a running review now checks gitmoot's own [disk_guard] statfs floor instead of cancelling; rejected answers and admission still fail closed.
Decision: Tests Run
Raw runtime output was retained in local Gitmoot state and is not posted here. |
Fixes #2667 (reported by fleetup, msg 488077; janitor-side half by workspace-janitor, msg 488118/488438).
Changes
runJanitorStatuscalls--format json status --capacity. If an older janitor rejects it (non-zero exit withflag provided but not defined: -capacity), the same call retries plainstatuswithin the deadline. That fallback is remembered per binary, keyed by path, size, mtime, dev and inode, so an upgraded binary gets probed again. Timeouts are never retried.janitorStatusExecError) and no fresh cached sample remains,janitorUnavailableLocalGuardre-resolves the devices and runs the existing[disk_guard]statfs check. It cancels only if that floor is crossed or cannot be measured, and logsjanitor_unavailable_local_guard.reviewMeasurements; admission fails on any read error.Measured on this host:
--capacity39–145 ms vs full status 12.8–21.4 s at load ~126;data.capacity.volumesidentical.Tests
janitor_unavailable_above_floorandjanitor_other_policy_after_fallback.janitor_read_failed,StopsOnlyOwnedGeneration.TestJanitorStatusUsesCapacityFlagAndFallsBackForOlderJanitor(real script janitors: current, older, re-upgraded).test-check prove
janitor_read_failed.janitor_other_policyandStopsOnlyOwnedGeneration.-overlayrun of old code fails both for the intended reason. Mutants (all read errors treated as non-answers; rejected answers sent to the local guard) are caught.Gate: build, vet (+e2e), gofmt, generate-clean,
./internal/config, e2eJanitor|Capacity|DiskGuard|ReviewCapacityall pass. TheTestLocalReviewMonitor*subtests passed on new code across runs; one run hit the load-related start-wait timeout that also affects existing subtests.Deploy: binary only, no migration. Afterwards remove the interim
timeout_ms = 60000from[janitor_capacity]in the live config.Assignment: gitmoot coordinator seat, fixing reported gitmoot bugs. Implementation: gitmoot seat (delegated subagent, in-session; attribution gap, no implement job).