Skip to main content

blocking_grace

Function blocking_grace 

Source
pub fn blocking_grace(grace: Duration) -> Duration
Expand description

How long the blocking pool gets once the runtime’s own work is over.

server.shutdown_grace plus the endpoint’s close flush plus EXIT_SLACK, so the allowance a blocking task gets is the whole allowance the connections get and no less. Raising the grace raises both halves, which is what an operator setting that key expects.

The number matters because the thing being waited for cannot be cancelled. Name resolution runs getaddrinfo on the blocking pool and stays there until the stub resolver gives up, tens of seconds on a black-holed nameserver, and the client picks the name (D90). Without a bound the process exits one resolver timeout after the grace period rather than one grace period after the signal, and script/masque.service turns that into a SIGKILL at TimeoutStopSec.