Skip to content

Announce a task that exhausts its restart cap - #66

Merged
smjenness merged 1 commit into
mainfrom
dev/doctor-escalate-exhausted
Aug 2, 2026
Merged

Announce a task that exhausts its restart cap#66
smjenness merged 1 commit into
mainfrom
dev/doctor-escalate-exhausted

Conversation

@smjenness

Copy link
Copy Markdown
Collaborator

MAX_RESTARTS is the last thing between a pathological task and an unbounded requeue loop, and reaching it says something definite: the doctor has stopped intervening, and the task will hold its slot until walltime producing nothing. It said so with one lowercase restarts exhausted; leaving it in the middle of a verbose sweep, which is the same shape of silent ending as a TIME_LIMIT kill mailed to nobody.

The README already flagged this in the third-campaign write-up ("That cap was doing work it was never meant to do"), and a fifth campaign hit it again.

What happened

swfcalib task 41767827_48, running the pre-2.8.3 classifier, wedged in PSOCK worker startup and was requeued three times. SLURM appends across requeues, so one task log holds every attempt; segmenting it by the workflow's start markers and counting workers that finished loading statnet:

attempt lines workers loaded outcome
1 8-268 3 of 8 killed at 93m
2 269-529 3 of 8 killed at 90m
3 530-656 1 of 8 killed at 89m
4 657-1250 8 of 8 ran 1.42h, completed

About 4.5 hours to deliver one 95-minute batch. Nothing surfaced it except reading the sweep log by hand afterwards. (The node exclusions those events also wrote are the thing #62 fixed; this PR is only about the terminal state being audible.)

Change

  • !! EXHAUSTED token carrying task, classification, node and restart count, replacing the lowercase line.
  • exhausted= counter in the sweep summary alongside confirmed_starved_requeued= and cleared_as_transient=.
  • MAIL_TO, when set and mail is available, gets one message per newly exhausted task.

Emitted once per task, not once per sweep. The doctor re-probes every ten minutes and an exhausted task stays exhausted, so an undeduplicated alert would repeat until walltime and train the reader to skip it, leaving the state as silent as before. The campaign-scoped ledger already in STATE_FILE is the dedup key.

Notes

  • No behaviour change for any task below the cap, and the exhausted branch still declines to requeue.
  • The ledger's new exhausted <taskid> rows cannot collide with the node-offense rows: those are matched with ^$node and ^$node cpustarv$, both anchored on a leading node name.
  • MAIL_TO is unset by default, so this is opt-in and no existing deployment starts mailing.

Testing

bash -n clean; devtools::load_all() clean. The exhausted branch was exercised standalone across repeated sweeps: it alerts once for a task at the cap, stays silent on the next two sweeps for the same task, alerts separately for a second task, leaves a task under the cap on the requeue path, and lands the counter at 2.

MAX_RESTARTS is the last thing between a pathological task and an unbounded
requeue loop, and reaching it says something definite: the doctor has stopped
intervening, and the task will hold its slot until walltime producing nothing.
It said so with one lowercase `restarts exhausted; leaving it` in the middle of
a verbose sweep. That is the same shape of silent ending as a TIME_LIMIT kill
mailed to nobody, which is what this tooling exists because of.

Seen again on a fifth campaign, running the pre-2.8.3 classifier. swfcalib task
41767827_48 wedged in PSOCK worker startup and was requeued three times.
Segmenting its accumulated log by attempt, since SLURM appends across requeues,
gives 3 of 8 workers through package loading on the first attempt, 3 of 8 on the
second, 1 of 8 on the third, then all 8 on the fourth, which ran 1.42 hours and
completed. About 4.5 hours to deliver one 95-minute batch, and nothing surfaced
it except reading the sweep log by hand afterwards.

The cap now emits a `!! EXHAUSTED` token with the task, its classification, the
node and the restart count; the sweep summary gains an `exhausted=` counter; and
MAIL_TO, when set, receives one message per newly exhausted task.

Once per task, not once per sweep. The doctor re-probes every ten minutes and an
exhausted task stays exhausted, so an undeduplicated alert would repeat until
walltime and train the reader to skip it, which would leave the state as silent
as it was. The campaign-scoped ledger already in STATE_FILE is the dedup key,
and its `exhausted <taskid>` rows cannot collide with the node-offense rows,
which are matched on a leading node name.

Behaviour is unchanged for every task below the cap, and the escalation is
report-only in the sense that matters: it still declines to requeue.
@smjenness
smjenness merged commit 9581dd6 into main Aug 2, 2026
2 checks passed
@smjenness
smjenness deleted the dev/doctor-escalate-exhausted branch August 2, 2026 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant