Skip to main content

implement-graceful-shutdown

Implement graceful shutdown that stops admission, drains work, preserves durable state, releases resources, and terminates within platform limits. Use when services or workers receive planned or forced termination.

ソース情報

リポジトリ
protosphinx/sphinxstack
ソースの最終更新活動
2026年7月29日 13:55
検出された SKILL.md の言語
英語
スター
3
フォーク
0

インストール方法

デフォルトでは、最初にソースを確認する Prompt が選択されています。直接コマンドに切り替えるか、ローカルコピーをダウンロードすることもできます。

ソースファイルを確認

インストールを決める前に、SKILL.md と SkillsMP に表示されている付属ファイルをお読みください。

ファイルエクスプローラー
2 ファイル

SKILL.md を表示中

SKILL.md
ソースの指示 · 読み取り専用プレビュー
name
implement-graceful-shutdown
category
code
description
Implement graceful shutdown that stops admission, drains work, preserves durable state, releases resources, and terminates within platform limits. Use when services or workers receive planned or forced termination.
# implement-graceful-shutdown Assume the hard deadline will eventually arrive. ## When to use - Use for servers, workers, schedulers, consumers, and stateful processes. - Do not acknowledge unfinished work or block forever waiting for uncontrolled clients. ## Procedure 1. Record platform signals, readiness behavior, grace period, termination deadline, and orchestrator sequence. 2. Make signal handling idempotent and begin shutdown exactly once. 3. Mark the instance unready and stop accepting new requests, jobs, leases, or sessions. 4. Drain bounded in-flight work while propagating cancellation and deadlines. 5. Checkpoint or return durable work safely and flush critical buffered state. 6. Close listeners, connections, files, telemetry, and temporary resources in dependency order. 7. Exit nonzero when required preservation or cleanup fails and expose shutdown metrics. 8. Save a shutdown test report for idle, active, overloaded, stuck, repeated-signal, dependency-failure, and hard-kill cases. ## Done - A shutdown implementation defines admission stop, drain, checkpoint, cleanup, deadline, and exit behavior - Integration tests verify signals, repeated calls, in-flight work, forced termination, restart, and no lost acknowledged work
GitHubで見る