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:
- probing is concurrent, so it costs one
PROBE_TIMEOUT— 500 ms; but - discovery is
find_providers, whose rounds are each bounded byDEFAULT_ROUND_TIMEOUT(8 s) and whose round count is capped byMAX_LOOKUP_ROUNDS(4).
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.