Skip to content

fix(node): restore 500ms probe timeout - #1269

Merged
thiras merged 1 commit into
mainfrom
fix/1220-restore-probe-timeout
Jul 17, 2026
Merged

thiras merged 1 commit into
mainfrom
fix/1220-restore-probe-timeout

Conversation

@altanoruc

Copy link
Copy Markdown
Contributor

Summary

  • restore the node-origin probe collection ceiling from 5 seconds to the ADR-mandated 500 milliseconds
  • keep pull-through slack derived from probe and bounded DHT lookup costs, pinning the resulting 167.5-second default outer deadline
  • update all code and operator-facing commentary that restates the derived deadline

Root cause

The probe timeout was correctly reduced to 500 milliseconds, but a later relocation of the constant from node_origin.rs to selection.rs copied back the earlier 5-second value and documentation. Because PULL_THROUGH_OUTER_SLACK derives from that constant, the regression also inflated the default outer pull-through deadline from 167.5 seconds to 172 seconds.

Impact

Cold-miss probe collection again stops after 500 milliseconds, avoiding the 10x latency regression. Lookup rounds, probe behavior, all other timeouts, and ADR policy are unchanged.

Validation

  • red: cargo test -p decdn-node selection::tests --lib — 43 passed and the two new guards failed with 5s != 500ms and 172s != 167.5s
  • green: cargo test -p decdn-node selection::tests --lib — 45 passed
  • cargo test -p decdn-cli default_config_template_parses — passed
  • cargo fmt -- --check — passed
  • cargo clippy -p decdn-node -p decdn-cli --all-targets -- -D warnings — passed
  • broader cargo test -p decdn-node compiled and ran 630 library tests: 601 passed; 29 unrelated socket/OS tests were blocked by the restricted sandbox with Operation not permitted, and the environment denied an unsandboxed rerun

Closes #1220

@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@altanoruc, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 53 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Free

Run ID: 36310dc1-71b4-4e65-803a-5f1cb2984cd3

📥 Commits

Reviewing files that changed from the base of the PR and between 45c2ef8 and e81eb21.

📒 Files selected for processing (6)
  • crates/cli/src/commands/config.rs
  • crates/common/src/config/mod.rs
  • crates/common/src/config/types.rs
  • crates/node/src/handlers/client.rs
  • crates/node/src/runtime/mod.rs
  • crates/node/src/selection.rs

Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown

Contracts coverage

Line coverage: 88.92% (2488/2798 lines)
▲ +0.00pp vs base (88.92% → 88.92%)
Run: 29597181018

@github-actions

Copy link
Copy Markdown

Gas snapshot

No gas changes vs base.

@github-actions

Copy link
Copy Markdown

Coverage report

Total: 81.21% (was 81.21%, ● 0.00%) — 48330/59514 lines

File Coverage Lines Δ
crates/cli/src/commands/config.rs 69.53% 178/256 ● 0.00%
crates/common/src/config/mod.rs 97.02% 6567/6769 ● 0.00%
crates/node/src/handlers/client.rs 80.32% 1245/1550 ● 0.00%
crates/node/src/runtime/mod.rs 49.50% 1083/2188 ● 0.00%
crates/node/src/selection.rs 97.92% 565/577 ▲ +0.01%
History
Commit Total Δ vs base
e81eb21 (HEAD) 81.21% ● 0.00%

@altanoruc

Copy link
Copy Markdown
Contributor Author

Review

Verdict: LGTM. The fix is correct, the derived deadline arithmetic checks out, and every prose restatement of the old numbers was found and updated.

Verified

  • Constant matches the ADR. PROBE_TIMEOUT = 500ms matches ADR 001 § Probe response collection exactly, and the rewritten doc comment faithfully mirrors the ADR's reasoning (concurrent probes ⇒ single timeout bounds the whole collection phase; warm/0-RTT connections per ADR 015 make one round trip fit inter-continental RTTs). The concurrency claim is real: probe_and_rank in node_origin.rs uses join_all, so the phase is bounded by one PROBE_TIMEOUT.
  • Deadline arithmetic. outer_pull_deadline(20s, 20s) = (CHANNEL_OPEN 5 + per_candidate 20 + stall 20) × 3 + (0.5 + 4 × 8) = 135 + 32.5 = 167.5s. ✓ The BACKGROUND_FILL_HARD_CAP ratio update is right too: 3600 / 167.5 ≈ 21.5.
  • No stragglers. Grepped the branch for remaining 172 / stale probe references — none left outside this diff. The handlers::client / runtime / config prose sites listed in the pin test's inventory are all covered.
  • Tests. The new pin test on PROBE_TIMEOUT plus the updated outer_pull_deadline_at_defaults_is_167_5s (now with the formula in the assert message) are exactly the guards that would have caught the original copy-back regression.

One follow-up worth an issue (not this PR)

crates/cli/src/commands/fetch.rs:64 has SELECT_PROBE_TIMEOUT_MS: u64 = 5_000 — the client-side auto-discovery probe (#936). ADR 005 says the 500ms collection window "applies to clients picking nodes and nodes picking peers for a cache miss pull," so this looks like the same class of ADR drift, just on the client path. Out of scope for #1220 (node-side), but it may deserve its own issue so it doesn't get rediscovered the hard way.

Nit (take or leave)

The PULL_THROUGH_OUTER_SLACK history paragraph now states the old 10s-budget comparison using the new 500ms probe ("four discovery rounds plus the probe phase can cost 32.5 s against the old 10 s budget") — at the time the flat 10s existed, the probe was 5s, so the historical figure was 37s. The point stands either way; only mentioning it since this comment's whole theme is not letting restated numbers go stale.

@thiras
thiras merged commit 1fe3577 into main Jul 17, 2026
23 checks passed
@thiras
thiras deleted the fix/1220-restore-probe-timeout branch July 17, 2026 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PROBE_TIMEOUT regressed 500ms -> 5s, contradicting ADR 001 §Probe response collection

2 participants