﻿# Slurm pre-timeout signals: the batch shell and job steps have different targets

Choose and verify Slurm's pre-timeout signal target so checkpoint logic reaches the intended shell or job step rather than relying on assumed propagation.

Author: Retrivium team
Updated: 2026-11-06
Canonical URL: https://retrivium.ai/journal/slurm-signal-batch-child-delivery/
Language: en

A batch shell installs a checkpoint trap, but the model process in a job step never receives the expected warning. Another setup signals only the shell and assumes it automatically notified every child. Before increasing the warning interval, verify which process the selected Slurm option actually targets.

## Draw the launch hierarchy

Record batch shell, srun launcher, job steps and model processes with their identities. Identify where checkpoint handling is implemented. A shell trap and a signal handler in the model worker are different recipients. The [allocation handover guide](/journal/mirage-slurm-successor-provisioning-interruption-overlap/) distinguishes scheduler timing from application readiness; the same distinction applies when a warning exists but the application component responsible for persistence has not observed it.

## Read the configured target

The [sbatch reference](https://slurm.schedmd.com/sbatch.html) documents the pre-end signal option. Its B prefix sends the signal only to the batch shell, not the other processes. Without that prefix, the documented default signals job steps rather than the batch shell itself. Preserve the exact option with the submitted job. Do not infer delivery to a model process solely from a message printed by the shell, or assume a trap catches a signal intentionally directed elsewhere.

## Define any application forwarding

If the shell coordinates shutdown, specify how it tells the actual worker to checkpoint and how it observes completion. The [srun reference](https://slurm.schedmd.com/srun.html) describes the step launch and signal boundary; application-created children need a reviewed lifecycle too. Forwarding must target the intended attempt, not a recycled process identifier or an unrelated process sharing a name. Keep failures visible instead of letting a successful shell trap mask a worker that never started or already died.

## Budget persistence after notification

The sbatch documentation notes that event-handling resolution can send the warning earlier than requested. Treat the request as notification policy rather than an exact timing measurement. Record when the worker begins and completes a coherent save, and leave an application plan for insufficient time. The [checkpoint state guide](/journal/fg2-ray-tune-function-checkpoint-state-report/) explains the difference between a progress observation and saved continuation state. Signal receipt alone proves neither complete contents nor durable publication.

## Exercise both recipient arrangements

In a disposable allocation, use recognizable shell and worker handlers, then compare the intended recipient configurations. Save the launch tree, received signal records, checkpoint identity and final worker state. Include a worker that cannot complete persistence within the available interval and verify the application does not label its partial output valid. This proposed acceptance protocol asserts no measured checkpoint duration and does not require experimenting on a production job approaching its real time limit.

## Preserve what the warning cannot promise

An early warning does not extend the allocation or guarantee that cleanup finishes. Node failure and other abrupt termination can bypass the cooperative path altogether. Save notification evidence separately from checkpoint validation and final job termination. The useful contract is that the selected recipient triggers the declared persistence protocol under the tested timing conditions. It is not automatic propagation through any process tree, transparent process migration or proof that every accepted operation survives an interruption.
