Skip to main content

PULL_THROUGH_OUTER_SLACK

Constant PULL_THROUGH_OUTER_SLACK 

Source
pub const PULL_THROUGH_OUTER_SLACK: Duration;
Expand description

One-time headroom added on top of the MAX_PROVIDER_ATTEMPTS sequential per-candidate costs when computing the outer pull-through deadline (#859). It covers the one-time discover → probe → rank overhead: work that runs under the outer deadline but does not scale with the attempt count.

Derived, not chosen (#1145 review). A flat constant would be smaller than the thing it is named for:

At those defaults, four discovery rounds plus the probe phase can cost 32.5 s. A flat budget short of that leaves the outer deadline short of what the fetch can actually spend, so the tokio::time::timeout around discover → probe → rank → pull can fire while candidate #3 is still in its stall window — the #859 fallback starvation this formula exists to prevent, reachable at the defaults.

The fix is in two halves, and both are necessary: MAX_LOOKUP_ROUNDS makes discovery’s worst case finite, and this makes it a TERM. An unbounded cost cannot be budgeted for by any constant, however generous.