Skip to content

How the adapter proves a job's processes stopped

A job that shares a mutable checkpoint can't be recovered on Slurm's word that it ended. If the old run is still writing, a replacement started beside it corrupts the checkpoint. So dispatch puts the job in a hold for a person, and while the hold stands it asks the adapter's cessation signal, every minute, whether the ended execution's processes are gone (When a job can't isolate). A yes lifts the hold.

The Slurm adapter says yes only on evidence that the processes stopped. That Slurm reads the job as finished is not such evidence, and the rest of this page is about why.

Slurm ends only what it can see

Slurm kills a job's processes through the slurmstepd that owns each step. Each stepd kills its own step's cgroup when the step ends. slurmd ends a job by signalling the stepds it finds. A slurmd that registers with slurmctld reports the stepds still alive, and slurmctld kills only what is reported.

So a stepd that dies alone leaves its step's processes running, and nothing in Slurm kills them. Measured on sind, at Slurm 25.11.8 and 26.05.4: after a kill -9 of a batch stepd, the batch script and its children ran on as orphans in the job's cgroup. Slurm's purge ended the job and killed nothing. An scancel read CANCELLED, not COMPLETING, within five seconds, with the orphans still alive 46 seconds later.

The job reads ended, and its processes are still writing the checkpoint.

A reboot, not a slurmd restart

A restarted slurmd re-registers, and that can look like proof: the node is back, it has told slurmctld what runs on it, and anything it didn't mention should be gone. It isn't. Re-registration reports live stepds, and orphans have none, so a restart leaves them where they were.

A reboot ends every process on the node. So the slurm-node source says yes only for a node that has rebooted since the execution started, and is responding again. There is no kill grace to wait out afterwards, because nothing survived to be killed.

TestOrphansKeepTheCessationGate builds exactly this case on sind: a SIGKILLed batch stepd, the job ended by the purge or by scancel, then a slurmd restart, with the orphans still running. The adapter must not answer ceased.

Why BootTime has to be declared

The source reads the reboot from the BootTime that scontrol show node reports. That is the kernel's boot only when slurmd runs without -b. Under slurmd -b, BootTime is when slurmd started, so every restart moves it, and a restart would read as a reboot: the case above, answered wrongly.

Nothing a user can read from Slurm says whether -b is in use. No field shows the flag, and comparing BootTime with SlurmdStartTime doesn't tell either: a reconfigure re-executes slurmd carrying the boot time -b set, while SlurmdStartTime starts again.

So the adapter doesn't guess. The site declares cessation.bootTime: kernel, and until it does, the slurm-node source is left out of every call. Soperator starts slurmd with -b, so a cluster there leaves bootTime unset, and the Kubernetes source answers instead.

slurm-node stays in the default list, so declaring bootTime is all it takes to turn it on. Left out by default, it is left out quietly: the evidence's detail, or the ErrUnsupported error when nothing else is left, names cessation.bootTime. A site that lists slurm-node itself asked for something it isn't getting, so slurm.New warns it.

Which source answers which case

Each source answers per node of the execution, and the job has ceased once every node has at least one yes. A multi-node job can be answered by a mix: one node's pod replaced, another rebooted.

What happened to the node Source that shows it Why it is proof
its pod was deleted, and is gone kubernetes Kubernetes completes a pod's deletion only once its node answers or the node object is gone. A deletion still pending is not a yes
its pod was replaced: the pod there now was created after the execution started kubernetes the processes ran in the old pod
it rebooted after the execution started, with bootTime: kernel declared slurm-node a reboot ends every process
anything the site can tell, and the adapter can't command the site's command answers for every node at once, with its exit status

The Kubernetes source stands on Kubernetes' own guarantee, that a pod deleted with its node object, or force-deleted, is dead. An operator or a cloud controller that does either for a node that is only cut off from the network makes Kubernetes wrong, and the source with it.

That source also depends on mapping a Slurm node to the right pod. A wrong namespace or mapping would read every pod as gone, and every node as ceased. So slurm.New resolves one pod per partition before trusting the mapping, and turns the pod reads off with a warning when it can't.

A healed network partition shows in none of them: the node didn't reboot, and its pod is the one the execution ran in. Only the site's command, or a person, can say its old run stopped.

A preempted shared job still waits for a person

After a preemption, a time limit, a cancel or a non-zero exit, the node is fine. Its pod predates the execution and it didn't reboot, so neither built-in source can say yes. Unless the site's command answers, a preempted shared-checkpoint job holds for a person, as it would with no source at all. The hold escalates as overdue: at its deadline, 24 hours (dispatch.SharedHoldFor), and dispatch keeps asking while it stands, so a late yes still lifts it.

That is the cost of answering only on proof, and the adapter takes it on purpose: a hold that waits costs a person's time, and a yes that is wrong costs the checkpoint. A source for a node that stayed up while its live stepds cleared it is designed, in spec 0002 D6, but not built.