You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
node: pull-through outer deadline equals the per-candidate stream timeout — multi-provider fallback is dead under timeout-shaped failures #859
Candidate #1 stalls. Its per-candidate stream_fetch timeout and the handler's outer timeout fire at the same instant; the outer one cancels the whole NodeOrigin::fetch future — candidates #2..N are never tried and the partial work is dropped (cache not filled either). The advertised N-provider fallback only functions for fast failures (connect refused, immediate error).
Not a duplicate
Not on any open issue; wiring introduced with #831/#834.
Fix direction
Make the per-candidate timeout a fraction of the outer deadline (or budget the outer deadline across attempts); optionally let the pull continue in the background to fill the cache after the delivery path gives up.
The outer try_pull_through deadline in client.rs and the per-candidate pull_timeout in NodeOriginConfig are sourced from the same config value (node_pull_timeout_sec), so they always expire simultaneously. When candidate #1 hits a slow-stall failure, the outer deadline cancels the entire NodeOrigin::fetch future before the sequential MAX_PROVIDER_ATTEMPTS loop can reach candidates #2..N. The N-provider fallback is therefore only effective for fast failures (connect refused, immediate protocol error). Introduced in #831/#834.
📊 Assessment
Dimension
Value
Reasoning
Type
Bug
Correct behavior (N-provider fallback) is silently broken under a specific failure shape
Labels
bug, medium, rust (already set)
Appropriate — no additions needed
Coding agent
Suitable
Root cause pinpointed, file + line locations given, fix direction is stated; the only open choice is which timeout-budget strategy to adopt
💡 Notes and suggestions
Root cause recap
attach_pull_through is called with Duration::from_secs(cfg.cache.node_pull_timeout_sec) as the outer deadline, and NodeOriginConfig.pull_timeout is set to the same value. Inside NodeOrigin::fetch, the sequential loop calls stream_fetch with pull_timeout per candidate. When both clocks start at the same moment, they expire together, and tokio::time::timeout on the outer future wins the race and drops the in-progress fetch.
Fix options (ascending complexity)
Fractional per-candidate timeout — set NodeOriginConfig.pull_timeout = outer_deadline / MAX_PROVIDER_ATTEMPTS. Simple; works when attempts are uniform.
Elapsed-budget per-candidate timeout — before each stream_fetch call, compute remaining = outer_deadline − elapsed and use that as the candidate's deadline. More accurate but requires threading a deadline instant into NodeOrigin::fetch.
Background cache-fill — after the delivery path gives up, spawn a detached task to continue the fetch and fill the cache for future requests. Orthogonal to options 1/2; adds resilience but more complexity.
Suggested sub-tasks
Decide on budget strategy (option 1 is the minimal correct fix)
Update attach_pull_through / NodeOriginConfig wiring in runtime/mod.rs
Adjust try_pull_through in handlers/client.rs if needed
Activity
github-actions commentedon Jun 10, 2026
🎯 Triage report
The outer
try_pull_throughdeadline inclient.rsand the per-candidatepull_timeoutinNodeOriginConfigare sourced from the same config value (node_pull_timeout_sec), so they always expire simultaneously. When candidate #1 hits a slow-stall failure, the outer deadline cancels the entireNodeOrigin::fetchfuture before the sequentialMAX_PROVIDER_ATTEMPTSloop can reach candidates #2..N. The N-provider fallback is therefore only effective for fast failures (connect refused, immediate protocol error). Introduced in #831/#834.📊 Assessment
bug,medium,rust(already set)💡 Notes and suggestions
Root cause recap
attach_pull_throughis called withDuration::from_secs(cfg.cache.node_pull_timeout_sec)as the outer deadline, andNodeOriginConfig.pull_timeoutis set to the same value. InsideNodeOrigin::fetch, the sequential loop callsstream_fetchwithpull_timeoutper candidate. When both clocks start at the same moment, they expire together, andtokio::time::timeouton the outer future wins the race and drops the in-progress fetch.Fix options (ascending complexity)
NodeOriginConfig.pull_timeout = outer_deadline / MAX_PROVIDER_ATTEMPTS. Simple; works when attempts are uniform.stream_fetchcall, computeremaining = outer_deadline − elapsedand use that as the candidate's deadline. More accurate but requires threading a deadline instant intoNodeOrigin::fetch.Suggested sub-tasks
attach_pull_through/NodeOriginConfigwiring inruntime/mod.rstry_pull_throughinhandlers/client.rsif needednode_pull_timeout_secconfig docs/comments to clarify it is the outer deadlineKey files
crates/node/src/runtime/mod.rslines 925–927, 1293crates/node/src/handlers/client.rslines 297–320crates/node/src/node_origin.rslines 334–339Add this agentic workflows to your repo
To install this agentic workflow, run
fix(node): address review — recover poisoned bg-fill lock, fix timeou…
fix(node): derive pull-through outer deadline so multi-provider fallb…
fix(node): don't sign an authoritative NotFound for a backend fault o…
fix: address the multi-agent review of #1145
fix: address the second multi-agent review of #1145
fix: bounds that could not do their job — first-byte, warm budget, de…
fix: bound the requester's fetch loop, and classify what comes back (#…