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에서 보기