Skip to main content

REQUEST_TIMEOUT

Constant REQUEST_TIMEOUT 

Source
pub const REQUEST_TIMEOUT: Duration;
Expand description

How long any one request may take before this router gives up on it and answers 503 with an empty body.

Applies to every route, not only the anonymous ones the rate limiters single out: a slow backend or a stalled write should not be able to hold a connection (and the concurrency slot it occupies) open indefinitely. The body is empty rather than this crate’s usual {"error":..,"message":..} shape — tower_http::timeout::TimeoutLayer answers with a bare status and a default body directly, without going through this router’s handlers or its error type at all, which is what makes it a backstop that keeps working even if a handler itself is the thing hanging.