Skip to main content

DEFAULT_SHUTDOWN_GRACE

Constant DEFAULT_SHUTDOWN_GRACE 

Source
pub const DEFAULT_SHUTDOWN_GRACE: u64 = 5;
Expand description

Default grace period for a graceful shutdown, in seconds.

Long enough for an in-flight page load or API call to finish, and short on purpose: a client that keeps using a connection after GOAWAY instead of opening a fresh one — the Surge client does — has every new request fail for as long as the drain lasts, so the grace period is also a window of failed requests on the client, and it only buys time for transfers that are already running. Five seconds keeps that window short while still letting short exchanges complete. Well below a service manager’s own kill timeout (systemd’s default TimeoutStopSec is 90s).