Skip to content

feat: payload graceful stop - #8814

Merged
fstagni merged 2 commits into
DIRACGrid:integrationfrom
aldbr:wms-graceful-stop
Oct 5, 2026
Merged

fstagni merged 2 commits into
DIRACGrid:integrationfrom
aldbr:wms-graceful-stop

Conversation

@aldbr

@aldbr aldbr commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

Depends on #8746 (stacked on it: review the last commit only).

A payload stopped when its budget runs out is killed: whatever it had produced but not yet written is lost, and the job fails. The Watchdog still parsed StopSigRegex / StopSigNumber but no longer acted on them.

  • Once the budget left is below StopSigFinishWork, and the payload has done at least StopSigStartWork, the Watchdog sends StopSigNumber to the processes of this job matching StopSigRegex. It signals descendants of the JobWrapper only, never the JobWrapper itself, and does not escalate. The hard stop at the end of the budget stays as the backstop.
  • The options can now also be set in /Systems/WorkloadManagement/JobWrapper, which reaches jobs already submitted. The JDL still takes precedence.
  • CHANGE: StopSigStartSeconds / StopSigFinishSeconds become StopSigStartWork / StopSigFinishWork, in CPU work, so one figure means the same on fast and slow nodes.
  • A payload that stops on the signal it was sent exits 128 + N. The JobWrapper reports that as a success rather than an application error, unless the Watchdog then had to kill it anyway.
  • New "Allocated time management" page in the Administrator Guide.

Tested with a real application that supports it (Gauss, a Gaudi simulation) launched as in production, including inside apptainer for its older slc6 and centos7 stacks. With StopSigNumber = 10 it finishes the event in progress, finalizes and exits 0 with a complete output file and success=True in its XML summary. The documented regex matches only the application process, not the launchers above it, nor other applications that would be terminated by the signal.

Part of #8745.

BEGINRELEASENOTES
*WorkloadManagement
NEW: the Watchdog can again ask a payload to wind down before its budget runs out (StopSigRegex, StopSigNumber, StopSigStartWork, StopSigFinishWork), configurable in /Systems/WorkloadManagement/JobWrapper as well as per job in the JDL
CHANGE: StopSigStartSeconds and StopSigFinishSeconds are replaced by StopSigStartWork and StopSigFinishWork, expressed in CPU work
FIX: a payload that stops on the signal the Watchdog sent it (exit code 128 + N) is not reported as an application error
NEW: "Allocated time management" page in the Administrator Guide
ENDRELEASENOTES

@aldbr aldbr linked an issue Sep 30, 2026 that may be closed by this pull request
@aldbr
aldbr marked this pull request as draft September 30, 2026 09:00
aldbr and others added 2 commits October 5, 2026 17:07
…budget runs out

A payload stopped when its budget runs out is killed, losing whatever it had
produced but not yet written, and the job fails. The Watchdog still parsed
StopSigRegex and StopSigNumber, but no longer acted on them.

It now sends StopSigNumber to the processes of this job matching
StopSigRegex once the budget left is below StopSigFinishWork, and not
before the payload has done StopSigStartWork. It signals only descendants
of the JobWrapper, never the JobWrapper itself, and does not escalate: the
hard stop stays as the backstop. The options can now also be set in
/Systems/WorkloadManagement/JobWrapper, which reaches jobs already
submitted; the JDL still takes precedence. StopSigStartSeconds and
StopSigFinishSeconds become StopSigStartWork and StopSigFinishWork, in CPU
work, so that one figure means the same on fast and slow nodes.

A payload that stops on the signal it was sent exits 128 + N. The
JobWrapper now reports that as a success rather than an application error,
unless the Watchdog then had to kill it anyway.

Also adds an "Allocated time management" page to the Administrator Guide.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…pper ConfigTemplate

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@aldbr
aldbr force-pushed the wms-graceful-stop branch from d2f023e to 313cda7 Compare October 5, 2026 15:08
@aldbr
aldbr marked this pull request as ready for review October 5, 2026 15:16
@fstagni
fstagni merged commit 703e72a into DIRACGrid:integration Oct 5, 2026
30 of 31 checks passed
@DIRACGridBot DIRACGridBot added the sweep:ignore Prevent sweeping from being ran for this PR label Oct 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sweep:ignore Prevent sweeping from being ran for this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Follow up] Time management after #8416

3 participants