Repository navigation
Description
decdn-node::node_origin_pull two_concurrent_pulls_to_one_provider_share_the_channel_ledger failed once on the coverage-instrumented test job, then passed on a plain re-run of the same commit.
Failing run: https://github.com/decdn/decdn/actions/runs/32906535499/job/97991821441 (commit 9e9733a)
FAIL [ 12.919s] (2813/3027) decdn-node::node_origin_pull two_concurrent_pulls_to_one_provider_share_the_channel_ledger
Error: the first concurrent pull returned NOTHING — its voucher collided with the other pull's on `prior_nonce + 1` and the upstream rejected it StaleNonce
at ./tests/node_origin_pull.rs:9740:5
Two observations.
The runtime is the tell. The failing attempt took 12.9s; the same test takes ~0.7s locally and passed 40/40 in a local stress loop. It only fails on the test job, which runs under cargo llvm-cov instrumentation with the whole workspace in parallel — so whatever the cause is, it needs the pull path to be an order of magnitude slower than it is unloaded.
The message asserts a cause it does not verify. The anyhow::ensure! at crates/node/tests/node_origin_pull.rs:9740 fires on any OriginFetch that is not AlreadyAdmitted, but its text states flatly that the voucher collided on prior_nonce + 1 and was rejected StaleNonce. A pull that returns nothing because open_or_reuse_pool blew its 5s CHANNEL_OPEN_CALLER_BUDGET (crates/node/src/selection.rs:72) — the far more likely reading of a 12.9s run — reports the same sentence, which sends a reader hunting a ledger-sharing bug that may not be there. The 12.9s attempt is roughly two of those budgets.
Worth doing either way:
- Make the failure distinguish the two outcomes, so the next occurrence says whether the upstream rejected a voucher or the pull never got a channel.
OriginFetch::Nothingalone cannot carry that; the fixture already records retirements and settlements, and thePullMissverdict is the thing that separatesBelowMargin/PoolOpenPendingfrom a realStaleNonce. - Then decide whether the underlying event is a genuine ledger-sharing race (
BuyerLedgers::get_or_seedkeys byLaneKey, and both pulls should resolve the same one) or just the caller budget expiring on a slow runner. The current message cannot tell you.
Not blocking anything right now — re-running the job cleared it.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Projects
- StatusShow more project fieldsDone
Activity
yigitdot commentedon Aug 26, 2026
Recurred on the coverage-instrumented
testjob, and this time the improved diagnostic from the fix paid off — it excludes both hypotheses it was written to distinguish.Sighting: run https://github.com/decdn/decdn/actions/runs/32943714091 (job 98105888611), on the merge of #1832 with
main— a test-only PR that touches neither the pull path nor this file.What the numbers say
Healthy baseline, captured locally by printing the two derived constants on a passing run:
Against that baseline:
combined_wire)retired[][]Three conclusions follow.
Neither documented cause fired.
retired=[]rules outAmountRegression(it would retire the channel).pending=0rules outCHANNEL_OPEN_CALLER_BUDGETexpiry, which is what the 12.9s runtime in the original report pointed at.timeout=0 stalled=0too. This is a third mode, and the enriched message is what makes that visible — the old text would have blamedStaleNonce.The ledger sharing itself WORKED. The recorded cumulative is 2627520, which is strictly greater than
single_wire(1578944). Two separate ledgers would each cap at 1578944; this one carried past it, so both pulls demonstrably drew on one ledger. The property the test exists to prove was holding at the moment it failed.The second pull aborted partway with
NotFound, at a suspiciously round offset.So the first pull settled its full wire total and the second got exactly 1 MiB further before returning
NotFound. The voucher count moved 26 vs 32 in step with it. An exact power-of-two boundary is not what CPU starvation looks like — it points at a window / interval boundary in the pull path rather than at a scheduling artifact, even though the trigger is still coverage contention.Reproduction status
Not reproducible locally: 0/12 failures for this test under 16 spinning background loops on a 14-core darwin box, and it passes in ~1.3s there versus 10.8s on the runner. Same amplification gap the original report noted. The lead above comes from the numbers, not from a repro.
Why this is reopened rather than fixed
I hit this while getting #1832 (a flaky-test cleanup for #1830) green. It is not caused by that PR and the fix is not test hygiene — conclusion 3 suggests a real early-termination path in the pull leg, which deserves its own diagnosis rather than being absorbed into an unrelated branch.
yigitdot commentedon Sep 1, 2026
Closing: the flake is real, but the two conclusions that reopened this do not survive a read of the code, and the conditions behind both sightings are gone from
main.The exact 1 MiB is forced by the fixture, not a lead
CHUNK_BYTES == MB_BYTES == 1_048_576is the protocol payment quantum (crates/protocol/src/client.rs:44-56): the buyer signs one voucher per chunk boundary, plus a closing voucher for the remainder.PAYLOAD_LENis 1.5 MiB (crates/node/tests/node_origin_pull.rs:84), whose own comment says it "crosses one 1 MiB chunk plus a closing voucher".So the shared ledger can only ever read
single_wire,single_wire + 1048576, orcombined_wire. 2627520 is the only value available to "first pull complete, second pull past its one and only mid-stream boundary and short of its closing voucher". The amounts agree exactly: atRATE = 10one pull costs10 + ceil(530368 * 10 / MiB) = 16, so healthy is 32 and the failing 26 is16 + 10— one chunk voucher. A starvation-induced abort lands on that same round number, because settlement granularity IS 1 MiB. Conclusion 3 is withdrawn."Neither documented cause fired" is a limit of the message, not evidence
The assertion prints three counters.
pull_verdict/classify_pull_error(crates/node/src/node_origin/mod.rs:2300-2440) carries about ten verdicts, and the rest meter counters the message never shows:node_pull_refused,node_pull_refused_unattributable,node_pull_voucher_rejected,node_pull_local_fault,node_pull_corruption,node_pull_unreachable. Every one of them reachesNotFoundthroughmiss_answer(mod.rs:708).The best fit is
PullVerdict::Unreachable, the ladder catch-all for any error that is not a typedPullTimeout/PullStalled/UpstreamRefused/UpstreamVoucherRejected/HashMismatch— i.e. a raw transport failure, which is exactly what llvm-cov starvation produces on a live QUIC stream. Checked against the tree at the failing commit (eb9d1b2): that arm only callsrecord_outcome(.., Outcome::Unreachable), meteringdecdn_node_pull_unreachable_total, which the diagnostic does not print.SettleOnDrophas meanwhile persisted the watermark at the last chunk boundary. That reproduces the entire observation:recordedat 2627520,retired=[],pending=0 timeout=0 stalled=0.The three zeros therefore exclude two verdicts and leave eight unexamined. Not a third mode.
Fixed since the last sighting
cdn/client/v1— the serve side node A runs in this fixture.DEFAULT_TEST_PULL_DEADLINES, on evidence that a 1.3s-uncontended fixture ended on the 20s stall bound at 21.4s, and addsretries = 2plusthreads-required = 2forbinary(node_origin_pull). Contention repro there: 2/6 failing to 0/6.min_throughput_bps: 0, so the floor cannot fire in it at all.No recurrence since.
If it returns
Widen the diagnostic rather than chasing the 1 MiB: dump every non-zero
decdn_node_pull_*counter instead of three named ones, reusing themetrics.encode()scrape incounter_value(node_origin_pull.rs:1029) with a prefix walk. That also removes that helper reading an absent line as0, which makes a renamed metric indistinguishable from one that never moved.