Skip to content

Install stop-signal handlers in the SLURM manager CLI - #4

Open
dotsdl wants to merge 1 commit into
mainfrom
service-termination-signals
Open

Install stop-signal handlers in the SLURM manager CLI#4
dotsdl wants to merge 1 commit into
mainfrom
service-termination-signals

Conversation

@dotsdl

@dotsdl dotsdl commented May 28, 2026

Copy link
Copy Markdown
Member

Summary

The SLURM start command ran manager.start() with no signal handling, so SIGTERM — the signal systemd/scancel/supervisors actually send — terminated the process without running ComputeManager.start()'s finally block. The result was an orphaned ComputeManagerRegistration in the state store on every normal shutdown (only an interactive Ctrl-C / SIGINT cleaned up).

This wires the start command to alchemiscale.compute.signals.install_stop_handlers, which registers SIGHUP/SIGINT/SIGTERM handlers that call manager.stop() (now interruptible, so it wakes the inter-cycle sleep promptly) and let the loop unwind through its deregistration finally.

install_stop_handlers(manager)
try:
    manager.start()
except KeyboardInterrupt:
    pass

Dependency

Requires the install_stop_handlers helper (and interruptible-sleep changes) added in the core repo:
OpenFreeEnergy/alchemiscale#503. Merge that first.

🤖 Generated with Claude Code

The 'start' command ran manager.start() with no signal handling, so SIGTERM (sent by systemd/scancel/etc.) bypassed the manager's finally block and orphaned its ComputeManagerRegistration. It now installs SIGHUP/SIGINT/SIGTERM handlers via alchemiscale.compute.signals.install_stop_handlers, so stop() runs and the registration deregisters cleanly.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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