signal-handling-conventions
Skill7 starsChanged 5 days agoMITView on GitHub
Signals and graceful shutdown for long-running processes. TRIGGER when: writing or editing the `main` of a long-running process, an HTTP or RPC server, a worker, a queue consumer or a daemon loop; wiring shutdown, signal handlers or drain logic; user asks about SIGTERM, SIGINT or graceful shutdown. SKIP when: a short-lived one-shot (CLI, library, script).
1 other project uses a version of this.
Adopted by
Most recently taken up by
- leroyguillaume/claudeword for word, first seen Nov 29, 2026
Other versions1 project uses a version of this.
Word for word · 1
- leroyguillaume/claude★ 7100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository54 other files it gives its agents.
- adr-conventionsSkill
- api-conventionsSkill
- architecture-conventionsSkill
- argocd-conventionsSkill
- ci-conventionsSkill
- config-conventionsSkill
- contributing-conventionsSkill
- councilSkill
- cryptography-conventionsSkill
- dependency-update-conventionsSkill
- diagram-conventionsSkill
- docker-conventionsSkill
- documentation-conventionsSkill
- frontend-conventionsSkill
- github-actions-conventionsSkill
- github-issue-conventionsSkill
- github-pr-conventionsSkill
- github-repo-settingsSkill
- gitlab-ci-conventionsSkill
- helm-conventionsSkill
- herdr-core-delegationSkill
- herdr-delegationSkill
- herdr-tui-delegationSkill
- kopf-conventionsSkill
- kubernetes-operator-conventionsSkill
- logging-conventionsSkill
- logo-conventionsSkill
- mise-conventionsSkill
- ollama-conventionsSkill
- openssf-conventionsSkill
- pr-conventionsSkill
- pre-commit-conventionsSkill
- project-metadata-conventionsSkill
- python-async-conventionsSkill
- python-conventionsSkill
- readme-conventionsSkill
- release-script-conventionsSkill
- release-supply-chain-conventionsSkill
- renovate-ci-conventionsSkill
- rest-conventionsSkill
- rust-build-conventionsSkill
- rust-conventionsSkill
- rust-http-conventionsSkill
- security-policy-conventionsSkill
- sql-conventionsSkill
- starlight-conventionsSkill
- systemd-conventionsSkill
- system-user-conventionsSkill
- task-conventionsSkill
- terraform-conventionsSkill
- topic-splittingSkill
- ui-copy-conventionsSkill
- web-layout-conventionsSkill
- yaml-conventionsSkill
The file
Files
Signal handling and graceful shutdown
Applies to every long-running process (servers, workers, daemons) in any
language or runtime. The language skills (rust-conventions,
python-conventions) give the mechanics: which signal API, and how to wire
shutdown to it.
- Handle both
SIGTERMandSIGINTand shut down gracefully on either.SIGTERMis what an orchestrator (Docker, Kubernetes, systemd, a process manager) sends to stop a process;SIGINTis Ctrl-C in a terminal. A process that ignoresSIGTERMis killed withSIGKILLafter the grace period (Docker's default is 10s), losing in-flight work. SIGKILL(andSIGSTOP) cannot be caught — do not try. The whole point of handlingSIGTERMis to finish cleanly before the orchestrator escalates toSIGKILL.- A graceful shutdown stops accepting new work (close listeners, stop pulling from the queue) and lets in-flight work drain within the grace period, then exits 0. Release external resources (connections, locks, temp files) on the way out.
- For pull-based workers, make interruption safe rather than relying on a clean drain: the unit of work should be idempotent / re-runnable so that a process killed mid-task is simply retried (e.g. a job left "processing" is requeued by a reaper). Cooperative shutdown then reduces wasted work; it is not the only thing standing between you and corruption.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

