Skip to main content

Module supervise

Module supervise 

Source
Expand description

Server-task supervision: run a binary’s spawned servers until a shutdown signal, treating any earlier exit as fatal.

A process whose serving task has died must flip readiness off and exit (so the orchestrator restarts it) rather than keep answering /readyz over a dead surface.

Functions§

drain_grace
Resolve the drain grace from POLYCHROME_DRAIN_GRACE_SECS, falling back to a default of 25 seconds, comfortably under the Kubernetes default terminationGracePeriodSeconds (30s).
until_shutdown
Block until shutdown is cancelled or any task in servers finishes.