Skip to content

fix(client): time probe RTT on the open connection, log lane coverage - #2248

Merged
alpergundogdu merged 1 commit into
mainfrom
claude/probe-rtt-coverage-logging
Sep 30, 2026
Merged

alpergundogdu merged 1 commit into
mainfrom
claude/probe-rtt-coverage-logging

Conversation

@alpergundogdu

Copy link
Copy Markdown
Contributor

Why

A testnet decdn bundle pull of Mistral 7B (29 GB) from a UK client showed two problems:

  • Probe RTT timed the connect. probe_once measured connect + TLS handshake + relay + hole punch. A cold dial to nearby holders read 200-330 ms, while a peer with a warm connection read ~30 ms. Proxy warming then routed through lon1 "instead of the best holder (300.8ms)", even though nbg1 and fra1 hold the blob about 30 ms away.
  • Coverage wasn't visible. One shard's last ~1.6 GB went to nbg1 alone while three other holders sat idle. The logs couldn't show why. The cause turned out to be partial coverage: fra1 holds blocks 0-15 and 21-28, ash1 holds 42-54 and 67, lon1 holds only 55.

What

  • probe: times only the request/response exchange on the open connection. It then waits up to 500 ms for hole punching to select a direct path, and uses that path's QUIC RTT when it is lower. The ADR 005 negative now describes this.
  • scheduler: logs the first plan (pending byte runs) and each lane's block coverage at debug.

Evidence

Cold decdn probe against testnet nodes, before and after, with ICMP ping for comparison:

node before after ping
lon1 ~30 (warm) / 311 13-17 13-42
nbg1 281 35-38 27-47
fra1 279 55-100 33-73
hel1 210 48-64 39-131
bcl 333 114-116 (ICMP blocked)

A peer that stays on the relay for longer than the grace still reads its relay RTT. The ADR documents this.

Test plan

  • cargo nextest run --workspace: 4338 passed
  • cargo clippy --workspace --all-targets --all-features, RUSTDOCFLAGS="-D warnings" cargo doc
  • New unit test for the coverage formatter
  • Manual cold probes against 6 testnet nodes (table above)

🤖 Generated with Claude Code

Probe RTT timed connect + handshake + hole punch, so a cold dial to a
nearby holder read 200-330 ms while a peer with a warm connection read
~30 ms. On a testnet bundle pull of Mistral 7B this made proxy warming
route through lon1 "instead of the best holder (300.8ms)" although nbg1
and fra1 hold the blob ~30 ms away.

- probe: time the request/response exchange only, then wait up to 500 ms
  for hole punching to select a direct path and take its RTT when lower.
  Cold probes now match ping (nbg1 35 ms, lon1 15 ms, fra1 55 ms, bcl
  115 ms). ADR 005 negative updated to match.
- scheduler: log the first plan and each lane's block coverage at debug,
  so a range that waits on one holder can be traced to coverage.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copilot AI balanced review requested due to automatic review settings September 30, 2026 10:45

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 encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@github-code-quality

Copy link
Copy Markdown

Code Coverage Overview

Languages: Rust

Rust / code-coverage/cargo-llvm-cov

The overall line coverage in commit 00dabf2 in the claude/probe-rtt-cov... branch remains at 87%, unchanged from commit e13878f in the main branch.

Show a line coverage summary of the most impacted files.
File main e13878f claude/probe-rtt-cov... 00dabf2 +/-
crates/client/src/scheduler.rs 95% 94% -1%
crates/client/src/probe.rs 99% 98% -1%
crates/cache/src/engine.rs 94% 94% 0%
crates/protocol/src/framing.rs 97% 97% 0%
crates/client/s...c/connection.rs 97% 97% 0%

@alpergundogdu
alpergundogdu merged commit 4fd9b70 into main Sep 30, 2026
30 of 31 checks passed
@alpergundogdu
alpergundogdu deleted the claude/probe-rtt-coverage-logging branch September 30, 2026 11:22
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.

2 participants