Skip to main content

DEFAULT_CONNECT_TIMEOUT

Constant DEFAULT_CONNECT_TIMEOUT 

Source
pub const DEFAULT_CONNECT_TIMEOUT: u64 = 10;
Expand description

Default budget for reaching a target, in seconds.

Applied twice per request and separately: once to name resolution, once to the whole list of addresses the name resolved to. A tunnel slot and the file descriptor behind it are held for the length of both, so without a budget an unreachable target pins them for however long the operating system waits on a SYN that draws no answer — on Linux roughly two minutes, which is long enough for ordinary browsing to a black-holed address to exhaust max_targets_per_conn on its own.

Ten seconds is well past a healthy connect on any path this proxy serves (the production RTT is under 100 ms) while being short enough that a client’s budget is not consumed by one dead target. Zero restores the unbounded behaviour and leaves the wait to the operating system.