Repository navigation
Conversation
…p carries the last fault A lane build that keeps failing logged every fault at DEBUG, so an RPC outage during pool open or reuse looked like a silent stall to a monitor that filters on WARN. The build fault now logs at WARN once its provider's retry wait reaches BUILD_RETRY_CAP (the sixth failure in a row), and DEBUG below it. The backoff bounds the line to one per 30 s per provider. A fetch that gives up while a lane build is failing carries the last build fault as LastBuildFault context on its GaveUp, so the give-up names what kept failing; downcast_ref::<GaveUp>() still finds it. The observability ADR now states how the client bounds its provider-triggered WARN lines without a per-cause throttle. Closes #2371
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
Code coverage overviewLanguages: Rust, Solidity Rust / code-coverage/cargo-llvm-cov
View coverage of the 7 most impacted files.
Solidity / code-coverage/forge
ℹ️ Calculations represent line coverage. Results may change as calculations are updated. Updated |
| **Provider-triggered warnings in the client.** The client (`decdn-client`) runs in the CLI and on the upstream leg of the node, so a remote provider can also fire client `WARN` lines. The client has no per-cause throttle. Its backoffs bound these lines: | ||
|
|
||
| - A lane fault logs at `WARN` when the fault is a source fault or a fatal fault. A source fault cools its provider for 2 s. Each further fault in a row doubles the cooldown, up to 60 s. A cooling provider starts no new stream. A verified byte resets the streak, so a provider can fire a faster line only after it serves paid bytes. |
There was a problem hiding this comment.
Fixed in f3b5884. The bullet no longer says a faster line needs paid bytes. It now lists the three exceptions: streams already running can still fault; a decline that leaves the hash does not cool the provider, though declined stops new starts for that hash; and a successful first open resets the streak with no payload bytes.
| **Provider-triggered warnings in the client.** The client (`decdn-client`) runs in the CLI and on the upstream leg of the node, so a remote provider can also fire client `WARN` lines. The client has no per-cause throttle. Its backoffs bound these lines: | ||
|
|
||
| - A lane fault logs at `WARN` when the fault is a source fault or a fatal fault. A source fault cools its provider for 2 s. Each further fault in a row doubles the cooldown, up to 60 s. A cooling provider starts no new stream. A verified byte resets the streak, so a provider can fire a faster line only after it serves paid bytes. | ||
| - A lane build fault is chain-side. It logs at `DEBUG` until the retry wait of its provider reaches the 30 s cap, at the sixth failure in a row. From then on it logs at `WARN` with `provider`, `failures`, and `error`. The backoff holds the provider to one build per 30 s, so the line repeats at most once per 30 s per provider. A lane that builds resets the count. |
There was a problem hiding this comment.
Fixed in f3b5884. The ADR line and the comment at the log site now give the bound as one line per 30 s per provider within one fetch. Each fetch has its own backoff, so concurrent fetches, such as bundle entries, log independently.
…cooldown's exceptions
Gas snapshotNo gas changes vs base. |
…ource set Each provider keeps its own last build fault beside its build backoff, so a build that succeeds clears only its own provider. A give-up names the provider with the most failures in a row, and only once that count reaches BUILD_RETRY_WARN_AT, so a one-off failure is never named as what kept failing. The context drops the repeated LaneBuildFault prefix and is crate-private until the CLI reads it. The ADR and the log-site comment scope the backoff bound to one source set: a blob fetch uses one set for its size open and one for its drive.
alpergundogdu
left a comment
There was a problem hiding this comment.
The WARN threshold, the reset on success and the caller compatibility all check out. Three changes before merge:
1. A plain {} of a give-up must still read as the stop line. give_up wraps GaveUp in a LastBuildFault context, and anyhow shows only the outermost context for {}, %err and to_string(). An SDK user logging {err} then sees "lane builds for 0x... failed 6 times in a row: ..." and loses "no progress for Xm; rerun to resume". Please make LastBuildFault's Display start with the give-up itself (for example "gave up while lane builds for 0x... kept failing: ..."), or carry the GaveUp text in it, so a bare {} still says the fetch stopped and can be rerun.
2. Name a build fault only when it explains the stall. give_up (crates/client/src/source_set.rs ~L697) picks the provider with the most failures from all of build_retry, and nothing removes an entry when a provider leaves the holder set or declines. So if A's builds fail 6+ times and A then leaves, while B holds a lane whose streams stall, the give-up blames A's fault and the operator chases the wrong cause. Please:
- attach
LastBuildFaultonly whenself.lanesis empty (no working lane), and - consider only providers still in the holder set and not declined.
Add a test for each: a provider no longer held is not named, and no fault is named while a lane exists.
3. Nit: log_build_fault sanitizes the fault chain a second time. lane_built already stored the sanitized text in BuildRetry.fault, so read it from there.
…erve
The context text ends with the give-up's own, so a plain {} of the error
still says the fetch stopped and a rerun resumes. A provider that declined
the blob or is marked absent is never named, and its lane does not count
as one that can serve. log_build_fault reads the fault lane_built stored.
|
All three addressed in 24f7b5a. 1. Plain 2. Only a fault that explains the stall. 3. Nit. |

Closes #2371.
Mapping to the issue's proposal
SourceSet::log_build_faultreplaces the DEBUG "lane build failed" lines inscheduler.rsandfirst_open.rs. It logs DEBUG until the provider's build backoff reachesBUILD_RETRY_CAP(BUILD_RETRY_WARN_AT= 6 failures in a row, pinned by a test againstBackoff::fail), then WARN withprovider,failuresand the sanitizederrorchain. Past the cap the backoff holds each provider to one build per 30 s, which bounds the WARN line. A lane that builds resets the count.GaveUpis unchanged (no new field):SourceSet::give_upwraps it with a crate-privateLastBuildFaultcontext naming the provider with the most build failures in a row, once that count reachesBUILD_RETRY_WARN_ATand while it has built no lane. It does so only while no built lane can serve, and never names a provider that declined the blob or is marked absent. Its text ends with the give-up text, so a plain{}still reads as the stop line. Each provider keeps its fault beside its backoff inbuild_retry, so a success clears only its own provider. The full chain names what kept failing anddowncast_ref::<GaveUp>()keeps working.fold_late_buildstays at DEBUG: those builds end after the fetch did and never reachlane_built.TopUpFailed(already fixed). feat!: scope node refusals to three classes and recover funding once per fetch #2354 deletedTopUpFailed; a top-up runs at most once per fetch throughRecoveryGate::stepand its failure ends the fetch, so nothing persists to escalate.adr/appendix-observability.mdnow states the client-side bounds: lane-fault WARN lines are bounded by the health cooldown (2 s doubling to 60 s), build-fault WARN lines by the 30 s backoff cap, so no per-cause throttle is added.The extra-stream refusal rule from the issue comment is deliberately not included: per the maintainer note it needs evidence from real pull logs first.
Note
The CLI's
stop_messageprints onlyGaveUp's own line, sodecdn getdoes not show the new context yet; the full chain reaches{:#}callers (node logs, SDK users, activity records). Deferred to a follow-up because #3015 also editsinterrupt.rs. The backoff, count and decline bounds are perSourceSet(a blob fetch uses one for the size open and one for the drive); the ADR says so.Tests
source_set::tests::the_build_warn_threshold_is_where_the_backoff_reaches_its_capsource_set::tests::a_lane_build_logs_warn_once_its_backoff_reaches_the_cap(DEBUG below the cap, WARN at and past it naming provider + failures, success resets to DEBUG)source_set::tests::a_give_up_names_a_persistent_build_fault_and_stays_a_gave_up,a_give_up_does_not_name_a_build_fault_below_the_threshold,a_give_up_names_the_provider_with_the_most_build_failures,a_give_up_names_no_build_fault_while_a_lane_is_built,a_give_up_does_not_name_a_provider_that_left,a_prebuilt_lane_clears_the_build_faultscheduler::tests::an_acquire_whose_builds_keep_failing_gives_up_naming_the_faultfirst_open::tests::a_give_up_while_builds_fail_names_the_last_build_fault(end to end throughfirst_open)cargo nextest run -p decdn-client --no-fail-fast: 1196/1196 pass.cargo clippy --workspace --all-targets -- -D warningsandcargo fmt -- --checkare clean.