Skip to content

Exit codes of the deadline wrapper

Hold, release, requeue and restore calls run as deadline-wrapped scripts. Each scontrol call in a script ends with a status, which the script prints as a framed line and which becomes the script's exit status if it is the last call.

Statuses

Status Means The adapter returns
0 scontrol succeeded success
75 the check refused: the host's clock was past the call's deadline, and scontrol was not run slurm.ErrExpired, which is a dispatch.ErrRejected
125 timeout itself failed. It also exits 125 for a failure after scontrol started dispatch.ErrOutcomeUnknown
126, 127 timeout could not start scontrol dispatch.ErrRejected
137 scontrol was killed at the bound B (128 plus SIGKILL) dispatch.ErrOutcomeUnknown
any other 1 to 255 scontrol's own failure dispatch.ErrRejected if its message is on the list below, otherwise dispatch.ErrOutcomeUnknown

Anything over 255, or not a plain decimal, is an unreadable status and an unknown outcome.

Messages accepted as refusals

A failed scontrol is a refusal only if every non-blank line of its stderr is <message> for job <id>, with the job's own id and a message allowed for that call. A call whose output has any other line, or two different messages, is an unknown outcome.

Call Message Result
Hold, Release Job is no longer pending execution ErrRejected
RestoreRequeueBit Job has already finished success: the bit no longer matters
Requeue, step 1 (set the bit) Job has already finished ErrRejected
Requeue, step 2 (requeue) Requested operation is presently disabled, Job is pending execution or Job has already finished ErrRejected
Requeue, step 3 (clear the bit) Job has already finished the bit counts as cleared

The messages are the ones slurmctld returns after it has decided and changed nothing. Open (scontrol release) is not wrapped, but reads its refusals the same way: Job has already finished is ErrRejected, and Invalid job id specified is dispatch.ErrNotFound. The text of the lines may also arrive with a slurm_suspend error: prefix there.

The status line

Every call prints one line to stderr before the next call starts:

<RS>DSL <nonce> call <i> <status>

<RS> is the byte 0x1E. <nonce> is the script's random nonce, in hexadecimal. <i> is the call's number in the script: 1 for a hold, release or restore; 1 to 3 for a requeue. <status> is the statuses above. Text before the line is that call's own stderr.

A call that the check skipped for want of a prior success (the requeue step after a failed set) prints no line. The script's exit status is the last printed call's.

The reader refuses a line with another script's nonce, a number that is not greater than the previous, a status over 255, text after the last line, no line at all, and an exit status that is not the last call's. Each is an unknown outcome.

A requeue's combined result

A requeue script has three calls, and its result combines them.

  • Step 1 (set the bit) did not succeed. Step 2 does not run. The result is step 1's: ErrExpired for 75, ErrRejected for a refusal. If step 1's outcome is unknown, the result is ErrOutcomeUnknown with a note that the requeue bit may be left set, since the setting may have landed unseen. Step 3 still runs in every case but 75.
  • Step 3 (clear the bit) succeeded, or found the job finished. The result is step 2's own: success, ErrRejected for a refusal, ErrExpired, or ErrOutcomeUnknown.
  • Step 3 did not clear the bit. The result says the requeue bit may be left set on the job. It is ErrOutcomeUnknown if step 3 ran (any status other than 75, 126 and 127) or if step 2's outcome was unknown. If step 3 certainly did not run, the bit is known to be set, and the error carries no dispatch sentinel. It is never ErrRejected, even when step 2 was refused, because something may have changed.
  • The script's output cannot be read, or reports the wrong calls. ErrOutcomeUnknown, with the same note.

A set bit shows as RequeueBit on the object, and RestoreRequeueBit clears it.

Constants

Name Value Used for
B 2 × MessageTimeout + 5s, rounded up to whole seconds timeout -s KILL on each scontrol
script bound, hold, release, restore B + 1s + ssh.connectTimeout ends the session
script bound, requeue 3 × (B + 1s) + ssh.connectTimeout ends the session
deadline check date +%s is at most deadline − 1 seconds decides between running and status 75
call margin 5 seconds part of CallBound
start time format 2006-01-02T15:04:05, UTC the hold's StartTime