Repository navigation
Description
Symptom
node_origin_pull::node_origin_not_found_refusal_does_not_tar_upstream fails about half the time. It fails at the first counter assert:
Error: expected metric line `decdn_node_pull_refused_total 1`; got: ... decdn_node_pull_refused_total 0
In the failing runs, node_pull_attempts_total is 1 and node_pull_success_total is 1. B pulls from A on the first attempt and never tries N, the refusing candidate. Nextest retries usually hide the failure, which shows up as 1 flaky in the summary.
Repro (macOS, 14 cores)
cargo nextest run -p decdn-node capacity_bond_registry node_origin --retries 0 --no-fail-fast
Failure rate over repeated runs of that command:
| Commit | Failures |
|---|---|
e13878fe (before #2248) |
1/10 |
4fd9b701 (#2248) |
6/10 |
main @ cb83e28b |
6/10 |
Likely cause
The test relies on N ranking first because N quotes STALL_RATE = RATE / 2. But selection::compute_score is rate * rtt / rep², and node_origin::ms_to_u32 truncates the probe RTT to whole milliseconds. #2248 times the probe RTT on the already-open connection, so it no longer includes the dial. On loopback that RTT is often under 1 ms, so both candidates get rtt_ms = 0, both score 0, and the random tier of the ADR 008 tie-breaker picks the order. When A ranks first, it delivers and N is never tried.
The rate-based ordering assumption also appears in other loopback tests in crates/node/tests/node_origin_pull.rs (for example, the staller near L2517: "quotes the cheaper STALL_RATE so it ranks ahead of A"). Those tests may be exposed to the same tie.
Possible fixes
- Test side: make the ordering deterministic without relying on RTT. For example, pin the candidate order or give the stub a fixed RTT.
- Product side: a 0 ms RTT erases the price signal entirely, so a sub-millisecond RTT turns ranking into a coin flip on rate. Consider a floor of 1 ms in
ms_to_u32for the score, or keep sub-ms precision incompute_score. This is a ranking change (ADR 008), so it needs a decision, not just a test fix.
Found while running the gate for #2259; that PR changes only log formatting and does not affect this test.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Projects
- StatusShow more project fieldsDone
Activity
thiras commentedon Oct 5, 2026
More sightings on Linux x86_64 (16 cores),
--retries 0. They include a second test that relies on the same ranking assumption.node_origin_not_found_refusal_does_not_tar_upstreamfails with the samedecdn_node_pull_refused_total 1assert:main@b37bbc4a, full-p decdn-node, sequential: 1/6-E 'binary(node_origin_pull)': 1/25a_probe_cache_hit_still_honours_the_negative_cachefails with:binary(origin_range_pull) | binary(node_origin_pull): 1/15binary(node_origin_pull): 1/25This test makes the same assumption: N is "quoting a cheaper rate so it ranks #1 and is always tried first" (
STALL_RATE).got 0means A ranked first and N was never asked. That matches the sub-millisecond RTT tie described above, so the test fix (or thems_to_u32floor decision) should cover it too.(
binary(node_origin_pull)onmain: 0/25 in the same session. The rate is low enough that 25 runs doesn't separate the two trees, and neither tree touches this ranking path.)