Skip to content

fix: box redeploy e2e futures, keep --json on an empty bundle pull, count stale mid-stream re-checks - #2814

Merged
yigitdot merged 4 commits into
mainfrom
claude/2786-2800-2806-low-level-9156ae
Nov 1, 2026
Merged

yigitdot merged 4 commits into
mainfrom
claude/2786-2800-2806-low-level-9156ae

Conversation

@yigitdot

@yigitdot yigitdot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

#2786: box the redeploy test's large futures (e2e)

On macOS, cargo clippy -p decdn-e2e --all-targets --features anvil-e2e -- -D warnings failed with three 16384-byte clippy::large_futures errors in node_pull_pool_redeploy.rs. The three stale_row_from_first_deployment(...) calls are now wrapped in Box::pin(...), as the file already does for the run_* entry points.

Tested: the anvil-e2e clippy command passes on macOS.

#2800: --json on a real bundle pull with nothing to fetch (cli)

When a real decdn get 'decdn:<hash>/' --json kept no entries, it printed a prose line on stdout. PullObserver::nothing_to_fetch now prints the run's PullReport under --json, the same object every real run prints, with fetched: 0 and excluded: N. It returns anyhow::Result<()>, and the caller propagates the error. The summary reads paid_bytes/wire_bytes from BundleReport, 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_counts and the shortfall warning still run. The dry-run path is unchanged.

Tested: cli_bundle_pull_unmatched_warning (anvil-e2e) gains a --json run of the emptied case. It parses stdout as one JSON object, asserts fetched == 0 and excluded == 2, and checks that the prose line is absent. The CLI unit test a_run_with_nothing_to_fetch_records_its_excluded_entries still 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_cached is the one helper that both serve loops use to re-check pool solvency. When a pool view is wired and chain_freshness reads stale, it now bumps decdn_serve_pool_recheck_stale_total and logs a throttled warn!. Its 1-minute throttle follows the pool_recheck_skip_warn pattern. The re-check still reads the projection and applies its usual verdict; the staleness itself stops no stream. The pool_view.rs module doc and adr/appendix-observability.md describe 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 unstamped ChainFreshness reads 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 in observability_counters_export_at_zero, and adr_registry_names_are_exported passes.

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_total scrape 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 warnings
  • cargo clippy -p decdn-e2e --all-targets --features anvil-e2e -- -D warnings
  • cargo fmt -- --check
  • CARGO_BUILD_WARNINGS=deny cargo doc --workspace --no-deps --document-private-items
  • cargo nextest run -p decdn-node -p decdn-cli --no-fail-fast: 3128 passed
  • cargo nextest run -p decdn-e2e --features anvil-e2e -E 'binary(cli_bundle_pull_unmatched_warning)': passed

Closes #2786
Closes #2800
Closes #2806

🤖 Generated with Claude Code

yigitdot and others added 3 commits November 1, 2026 09:11
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]>
Copilot AI balanced review requested due to automatic review settings November 1, 2026 06:26

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@github-code-quality

github-code-quality Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Code coverage overview

Languages: Rust

Rust / code-coverage/cargo-llvm-cov

main 4ebf92d claude/2786-2800-280... 6b115a4 +/-
77% 77% 0%
View coverage of the 4 most impacted files.
File main 4ebf92d claude/2786-2800-280... 6b115a4 +/-
crates/node/src/dht/publish.rs 80% 78% -2%
crates/cli/src/.../bundle_pull.rs 63% 63% 0%
crates/node/src...s/client/mod.rs 91% 91% 0%
crates/node/src...nt/serve_leg.rs 92% 93% +1%

ℹ️ Calculations represent line coverage. Results may change as calculations are updated.


Updated November 01, 2026 06:56 UTC

…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]>
@yigitdot
yigitdot requested a review from thiras November 1, 2026 21:39
@yigitdot
yigitdot merged commit 520e2e1 into main Nov 1, 2026
38 checks passed
@yigitdot
yigitdot deleted the claude/2786-2800-2806-low-level-9156ae branch November 1, 2026 21:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants