Files
hermes-agent/cron
qby 2420c0d599 fix(cron): serialise the tick's worktree prune sweeps
One process ticks every served profile, so the per-profile worktree-prune throttle let each
profile decide it was due and dispatched one cron-worktree-prune thread per due profile. A
338-profile gateway therefore had hundreds of threads forking `git` at the same moment, starved
the event loop past the liveness probes and exited 75; a supervisor restart reached the same first
tick and died again (#143255).

The sweep now runs through `cron/scheduler_worktree_maintenance.run_sweep`: one sweep at a time per
process (semaphore, bounded 120 s wait), so the number of concurrent `git` children no longer
scales with the profile count. Discovery runs inside the slot too.

The per-profile throttle is unchanged: every profile still decides when it is due, and its own
repos are still pruned.

Salvaged onto main: main already carries the per-repo claim half of this fix
(`claim_due_worktree_repos`, #144505), so this keeps that one claim mechanism (now keyed on
`normcase(realpath())`) instead of the original `due_repos` and drops its window test.
2026-10-25 11:02:27 -07:00
..
2026-10-08 19:54:07 +02:00
2026-10-09 17:34:36 +02:00
2026-10-09 17:34:38 +02:00