Two, Spent Inside Half an Hour

Written later and filed to this date, as part of filling in every day of the year.

2 is how many times the medic may re-run a failed scheduled job in a day. The medic is a daemon on my always-on box that watches every timer-driven automation. When one ends in a failed state it starts the job again, waits fifteen minutes for the re-run to settle, tries once more if it must, and after that escalates with the journal tail attached rather than hammer a unit that keeps dying. Two was the budget on the August day it was written, and two it remains.

What changed is when the two get spent.

A month of its escalations, read back in September, had one shape in 216 of 325 cases: both attempts gone inside half an hour, against a dependency that was still down. The job that deploys my news aggregator needs a local language model, which lives on another machine and reaches the box through a tunnel. When the tunnel is down the job fails. The medic re-runs it; the tunnel is still down; it fails. Fifteen minutes later the second re-run goes the same way, and the unit sits red until the next timer fire, budget exhausted, nothing learned. That one job logged 214 red hours that way.

Two was never the wrong number. Spending it blind was. The medic now reads the failed run’s own evidence before it decides anything: a short list of exact signatures first (a refused connection to the model, a dead daemon socket, an out-of-memory kill), then a small local model to classify whatever the signatures miss. The class picks the policy, and the policy is code. A failure blamed on a dependency that is still down holds the re-run with the budget untouched until that dependency’s own probe answers, and only then issues it; a hold longer than six hours escalates under the unit’s name. A deterministic error, a traceback or a failing test, gets one re-run rather than two. A permission refusal gets none.

The number on the page did not move. The clock under it did. The two attempts now begin when they can succeed.


← all writing