Repository navigation
fix: box redeploy e2e futures, keep --json on an empty bundle pull, count stale mid-stream re-checks - #2814
Merged
Conversation
On macOS the three stale_row_from_first_deployment futures exceed clippy's large_futures limit under anvil-e2e. Box them as the file already does for the run_* entry points. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…o fetch (#2800) A real decdn get of a bundle whose filters keep no entry printed a prose line on stdout even under --json. Under --json the empty-set exit now prints the same PullReport every real run prints: fetched 0, the excluded count, and the pull's own paid and wire bytes (zero; like every run's report, it leaves out the manifest fetch). nothing_to_fetch returns the report's result to the caller. The unmatched-warning e2e gains a --json run of the emptied case that parses stdout as one JSON object. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The mid-stream pool-solvency re-check reads the event-fed projection, which stops advancing while the node cannot reach the chain. Admission refuses once ChainFreshness reads stale, but a live stream kept passing re-checks against a frozen remaining with nothing to show for it. pool_view_status_cached, the one helper both serve loops re-check through, now counts decdn_serve_pool_recheck_stale_total and logs a throttled warn! when a wired chain freshness reads stale. Behaviour is unchanged: the re-check still reads the projection and the stream continues. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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 Rust / code-coverage/cargo-llvm-cov
View coverage of the 4 most impacted files.
ℹ️ Calculations represent line coverage. Results may change as calculations are updated. Updated |
…2806) Review follow-up on #2814. Two unit tests pin the branch independence of the stale and skip counts: a stale re-check that finds no status counts in both, and a stale freshness with no pool view wired counts nothing. The two metric-scrape helpers share one counter_total. The docs and the ADR row say that the staleness itself stops no stream (the re-check's usual verdict on the frozen data applies) and that the counter covers only streams admitted before the outage, since the admit gate refuses new streams while stale. Co-Authored-By: Claude Fable 5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#2786: box the redeploy test's large futures (e2e)
On macOS,
cargo clippy -p decdn-e2e --all-targets --features anvil-e2e -- -D warningsfailed with three 16384-byteclippy::large_futureserrors innode_pull_pool_redeploy.rs. The threestale_row_from_first_deployment(...)calls are now wrapped inBox::pin(...), as the file already does for therun_*entry points.Tested: the anvil-e2e clippy command passes on macOS.
#2800:
--jsonon a real bundle pull with nothing to fetch (cli)When a real
decdn get 'decdn:<hash>/' --jsonkept no entries, it printed a prose line on stdout.PullObserver::nothing_to_fetchnow prints the run'sPullReportunder--json, the same object every real run prints, withfetched: 0andexcluded: N. It returnsanyhow::Result<()>, and the caller propagates the error. The summary readspaid_bytes/wire_bytesfromBundleReport, which counts only the pull pass and leaves out the manifest fetch, so zeros here match what a real run reports.warn_leftover_partials,record_countsand the shortfall warning still run. The dry-run path is unchanged.Tested:
cli_bundle_pull_unmatched_warning(anvil-e2e) gains a--jsonrun of the emptied case. It parses stdout as one JSON object, assertsfetched == 0andexcluded == 2, and checks that the prose line is absent. The CLI unit testa_run_with_nothing_to_fetch_records_its_excluded_entriesstill passes.#2806: count a mid-stream pool re-check on stale chain reads (node)
This takes option 1 from the issue, with no behaviour change.
ClientHandler::pool_view_status_cachedis the one helper that both serve loops use to re-check pool solvency. When a pool view is wired andchain_freshnessreads stale, it now bumpsdecdn_serve_pool_recheck_stale_totaland logs a throttledwarn!. Its 1-minute throttle follows thepool_recheck_skip_warnpattern. The re-check still reads the projection and applies its usual verdict; the staleness itself stops no stream. Thepool_view.rsmodule doc andadr/appendix-observability.mddescribe the counter.Whether the re-check should instead fail closed (mirror admission's
ChainStale) is deferred to #2822, to be decided from this counter's production data.Tested: five unit tests in
handlers/client/tests.rs: an unstampedChainFreshnessreads stale, so the re-check is counted; a stamped one is not; with no freshness wired, it is not; a stale re-check that also finds no cached status bumps both the stale and the skipped counter; a stale freshness with no pool view wired counts nothing. The counter is also inobservability_counters_export_at_zero, andadr_registry_names_are_exportedpasses.Review pass
A four-agent review (code, comments, tests, silent failures) found no critical or important issues. The fourth commit applies its suggestions: the two edge-case tests above, a shared
counter_totalscrape helper in the tests, and tighter wording in the handler/metric/module docs and the ADR row (the staleness itself stops no stream; the counter covers only streams admitted before the outage).Verification (macOS)
cargo build && cargo clippy --workspace --all-targets -- -D warningscargo clippy -p decdn-e2e --all-targets --features anvil-e2e -- -D warningscargo fmt -- --checkCARGO_BUILD_WARNINGS=deny cargo doc --workspace --no-deps --document-private-itemscargo nextest run -p decdn-node -p decdn-cli --no-fail-fast: 3128 passedcargo nextest run -p decdn-e2e --features anvil-e2e -E 'binary(cli_bundle_pull_unmatched_warning)': passedCloses #2786
Closes #2800
Closes #2806
🤖 Generated with Claude Code