Skip to content

client: a leg that faults mid-pull is logged nowhere and its range waits for a busy lane (serial tail) #2230

Closed

Description

@thiras

Summary

During a multi-source decdn bundle pull, the client can stop sending a proof on a leg for 10 s, so the node times the stream out. When that happens, the client:

  1. logs nothing about the failed leg, and
  2. re-queues the leg's remaining range but hands it to another lane only after that lane finishes its own range.

Together these turn one mid-run provider loss into a silent serial tail. The cause of the 10 s proof gap itself is still unknown (see Open question).

Observed

Mistral bundle smoke pull (--hash 9194000d…af69e5 --namespace 1) on 2026-09-29, 00:21–00:29 UTC. CLI at cff5fb13, fleet redeployed 00:13 UTC. The run took 8m28s with 0 failed, downloaded 17.1 GB → reconstructed 29.0 GB.

  • fra1 / 998030. At 00:21:11 the client opened two legs to fra1 on one lane: b32596 [0, 1.24 GB) and 998030 [0, 1.67 GB).
    • The b32596 leg completed at ~22 MiB/s over 178 s.
    • The 998030 leg delivered ~2 MiB, then fra1's serve_stream span ended at 00:21:25: after payment: proof 1 of at most 8 for a 1048576-byte chunk (1048576 bytes owed, 0 more queued): proof read timed out after 10s: peer-side fault.
    • The client log (RUST_LOG=info,decdn_cli=debug,decdn_client=debug) has no line at all about this failure.
    • Range [2 MiB, 1.667 GB) was reopened to bcl at 00:27:34, only after bcl finished its own stripe range [1.667 GB, end). That is 6 min later, and it ran as a serial tail of ~80 s at ~20 MiB/s.
  • lon1 / 7cbb48. At 00:21:15 the client opened 3 legs to lon1 on 7cbb48.
    • All 3 failed node-side with the same proof 1 … proof read timed out after 10s (no voucher credited, counted as serve_stream_client_declined). The client made 0 B of progress on 7cbb48 in that window.
    • The client logged a concurrent gap of the same range set also failed: no terminal signal after the voucher write failed; … sending stopped by peer at 00:21:26. So it did write a proof, but after the node had already stopped the stream.
  • Other legs were healthy. Legs to bcl, hel1, nbg1 and ash1 progressed normally in the same window, at ~40–50 MB/s aggregate.

Why it is silent and serial (confirmed in code)

  • Scheduler path (crates/client/src/scheduler.rs, Err(e) arm at ~L941):
    • A retryable fault is stored in faults and its remainder is re-queued to pending, with no log.
    • fill_gap (driver.rs ~L1759–1875) also logs nothing on a leg error.
    • faults is read only when the fetch ends with bytes still missing (~L1471–1518). A fetch that recovers drops them unreported.
    • A worker holds one range until it finishes (module doc, ~L19–24). pick consults pending only when a worker returns for more work (~L455–500), and nothing interrupts a busy lane. The re-queued range therefore waits for the slowest surviving lane.
  • Stripe path (driver.rs ~L1254–1289):
    • A lane fault is stored and the remainder is pushed to the front of the queue, again unlogged.
    • The only WARN is keep_decisive (~L712), which fires only on a lane's second concurrent fault. lon1 (3 legs) got one; fra1 (1 leg) did not.
    • left the stripe is logged only after the whole drive returns (crates/cli/src/commands/fetch.rs ~L3024–3031).

This is a sibling of #2225, not a duplicate: #2225 covers blocks no lane covers (never queued), while here the range was re-queued after a retryable fault. The tail shape is the same.

Open question: the 10 s proof gap

These were ruled out:

  • Checkpoint backpressure. A checkpoint is queued only per 4 MiB batch (ranged_store.rs ~L513/528/869). The stalled legs had ≤2 MiB, and no ingest waited on a checkpoint slot line appears at 00:21.
  • Lane issuance lock contention. The lock covers a local sign plus a buffered write (ledger.rs ~L483/638), and fra1's sibling leg paid on the same ledger throughout.

One weak candidate remains:

  • The whole bundle runs on one task (bundle_pull.rs ~L1758, "no tokio::spawn"), and settle_lane → persist_watermark does a synchronous redb commit (fetch.rs ~L1394, ~L2434–2450).
  • A seconds-long fsync there could freeze every leg's proof write at once.
  • But legs to other nodes survived, so this fits only if they had spare credit window.

The existing floor WARN (lib.rs ~L3176, which logs unpolled_ms) cannot fire, because the node cuts the stream at 10 s, before the client's floor expires. Possibly overlaps #2211 hypothesis 1 (the client's reader is not polled).

Proposed

  • Log each leg fault where it happens (scheduler.rs Err(e) arm, driver.rs lane-fault arm) with provider, hash, offset, and bytes received.
  • Emit a per-leg debug line when a proof has been owed and unsent for more than ~5 s, so the next occurrence names the stall.
  • Let an idle or finished lane take a re-queued range, instead of waiting for a busy lane to finish its own.
  • Root-cause the proof gap once the debug line exists (move the redb commit off the shared task if it is the cause).

🤖 Generated with Claude Code

Activity

  1. added
    kind:bug
    area:cli
    area:payments
    on Sep 29, 2026
  2. self-assigned this
    on Sep 29, 2026
  3. thiras commented on Sep 29, 2026

    @thiras
    ContributorAuthor

    Node-side view of a stall: both ends wait on each other (ash1, 2026-09-29 05:48 run)

    This run used the 74e2cd42 client (with the #2231 proof-stall debug line) and a fleet redeployed at 05:44 UTC. For the first time we have both sides of one stall.

    Node side. ash1 serve_stream, trace 4791595894fb6c085345c5f51a69ef0a, 998030d5… [3221225472, +1610612736), failed after 203 s:

    after payment: proof 1 of at most 8 for a 1048576-byte chunk (1048576 bytes owed, 8 more queued): proof read timed out after 10s: peer-side fault

    So ash1 had already written 9 chunks (~9 MiB) past the paid watermark into the stream, and it was waiting for a proof.

    Client side, same leg, same seconds. For ~50 s the leg advanced about 1 MiB every 5–8 s, and every stall line was in the read phase with nothing owed:

    05:51:51 a leg phase ran past 5s peer=72b401 hash=998030 byte_offset=3221225472 cumulative=404750336 unproved=0 phase="read"
    05:51:59 … cumulative=405798912 unproved=0 phase="read"
    05:52:05 … cumulative=406847488 unproved=0 phase="read"
    05:52:16 … cumulative=407896064 unproved=1048576 phase="read"
    05:52:16 WARN a lane faulted mid-fetch … error=no terminal signal within 5s of the voucher write failing: … sending stopped by peer
    

    The client had proved everything it had received and was waiting for the next frame. The node had handed ~9 MiB to its QUIC send side and was waiting for the proof of bytes that the client never read. The data was stuck in transport. It was not stuck in the client's pay path or in the node's proof reader.

    It is per connection, not per host.

    • decdn_active_connections{instance="ash1"} equals decdn_streams_active, which is 3. So each stream has its own QUIC connection.
    • ash1's sibling b32596… leg on another connection stalled the same way. It shows unproved=0 phase="read" and faulted with no verified progress within 10s (trace 442e5fb96898cef9604a1e02f9a84889).
    • In the same window, other connections from ash1 to the same client ran fast. 57180673385cabcd8cad7d08c93c1391 moved 261 MB in 13.7 s, and caf56a2fd80c07091b26389b8277bfd7 moved 219 MB in 9.1 s.
    • Relay bytes on ash1 stayed small (~0.9 MB of relay sends in 7 min), so a relay path does not explain it.

    All 27 stall lines in this run have the same shape. Every one is phase="read". 24 have unproved=0, and the other 3 have at most one chunk unproved. The peers were fra1 ×12, nbg1 ×8, ash1 ×6 and hel1 ×1.

    Suggested next step. Record the QUIC path state of a stalled connection on both ends: the RTT, cwnd, bytes in flight, the lost-packet count and the selected path (direct or relay, IPv4 or IPv6). A good trigger is the moment the node enters the proof wait with queued chunks, or the moment the client's read phase passes 5 s. This client host has no IPv6, and both ends log sendmsg … NetworkUnreachable to IPv6 addresses. A connection whose selected path is an IPv6 or blackholed path would give exactly this picture.

  4. altanoruc commented on Sep 30, 2026

    @altanoruc
    Contributor

    Still reproduces on ef4bb891 (2026-09-30, fleet redeployed ~15:27 UTC)

    Same bundle (9194000d…), 5 runs, all completed with 0 failed. The stall hit run 1 only. Run 1 went through a VPN, as did run 2; runs 3–5 did not.

    Client side, run 1, 17:05:19–20 UTC. Three legs to ash1 (0xDb0E…), opened at the start of the run, faulted within a second of each other. Each had landed=0:

    a lane faulted; its remainder goes to the other lanes provider=0xDb0E… hash=ad7f7e… offset=2818572288 len=872415232 landed=0 fault=Source error=no verified progress for 10s
    a faulted lane's remainder waits for a busy lane: no running lane could take one more stream hash=ad7f7e… waiting=2
    … hash=b32596… offset=3087007744 len=67108864 landed=0 … waiting=8
    … hash=998030… offset=3288334336 len=1711485000 landed=0 … waiting=1
    

    The fault is now logged (the first checkbox). The remainder still waits for a busy lane.

    Node side, same seconds. ash1 serve_stream, all three legs:

    proof 1 of at most 8 for a 1048576-byte chunk (1048576 bytes owed, 0 more queued): proof read timed out after 10s: peer-side fault

    Traces: ea642d12e7437e64f2db2d395facd06b (998030, 10.0 s), fd8e1ebb84f04e9069f7889ecdbc093e (10.4 s), 80f8c102f8af9eac614143297d6248d6 (10.6 s). ash1 served 3.1 MB in total over the whole run and counted 3 serve_stream_client_declined.

    So both ends waited on each other again: the node waited for a proof, and the client had nothing verified to prove. That matches the shape in the comment above. It did not recur in runs 2–5, including run 2 on the same VPN path, which fits a per-connection transport stall rather than a host fault.

    🤖 Generated with Claude Code

  5. altanoruc commented on Sep 30, 2026

    @altanoruc
    Contributor

    Every stall in 10 more runs was proof 1, in a run's first minute (2026-09-30, ef4bb891, VPN off)

    10 decdn bundle pull runs, 18:52–21:13 UTC, one client, CLI at ef4bb891 built fresh, VPN off throughout. Models drawn at random from models.json (Mistral, gpt-oss-20b, Qwen2.5-7B, Whisper large-v3, SDXL). The stall hit 3 of 10 runs: 1, 3 and 9. It did not recur in the second SDXL run (run 10).

    Node side. All 11 stalled streams failed the same way, at the first proof:

    after payment: proof 1 of at most 8 for a 1048576-byte chunk (1048576 bytes owed, N more queued): proof read timed out after 10s: peer-side fault

    run provider node role legs time into run stream duration traces
    1 (Mistral) nbg1 holder 3 18–21 s 10.0–11.1 s d57af66b009e395d08299a490c4d8cea, f44eaadab268aa601934908d35453112, 22cdbe797145b4465249c09ceb0acef4
    3 (Qwen) nbg1, lon1 nbg1 proxy-warming, lon1 holder 6 44–48 s 22–30 s f40ff1fe1c5ba7629f9808ae013588c8, af323fcb64a2b80deb424e8005c18832, 26d3ddcd474a2785b5f7b459f829ebe2, 47bf32eb33e54299878c75ce2c8f04a6, 67169cbe3f194da1a04234e7264875d3, bcd9717399e3251476c80f6f5fdf6b42
    9 (Qwen) fra1 proxy-warming non-holder 2 27–32 s 17–19 s a4e1ec414efd07fa90ff42f217dced59, 922f3d90d521e8b8c7fdc04c46726d6c

    Client side. The fault is logged now:

    a lane faulted; its remainder goes to the other lanes provider=0x6B82… hash=b32596… offset=402653184 len=1275068416 landed=1048576 fault=Source error=no terminal signal after the voucher write failed; recovery read failed: … sending stopped by peer: error 0
    a lane faulted; … provider=0x6B82… hash=75e6ac… landed=10436608 … error=no verified progress for 10s
    

    What this narrows:

    • Every stall is at proof 1, in the run's first minute (18–48 s in), against holders (nbg1 in run 1, lon1 in run 3) and proxy-warming non-holders (nbg1 in run 3, fra1 in run 9) alike. Across the 10 runs, legs that were already paying never timed out on a proof. The only mid-run faults were isolated no verified progress for 10s after hundreds of MB (hel1, bcl).
    • In runs 3 and 9 the stream lasted 17–30 s, not 10 s. The node spent 7–20 s before its first paid chunk (upstream fill on a proxy, and on the holder lon1 too), then waited 10 s for proof 1.
    • All legs on one provider fail within ~2 s of each other, while legs to other providers keep paying. The weak candidate in the issue body, a whole-bundle freeze on a synchronous redb commit, fits badly: it would stall every lane, not one provider's. A per-lane stall around the first proof on a fresh lane fits better.
    • The client had verified bytes. landed was 1–10 MB on 9 of the 10 client-side lane faults (up to 60 MB in run 9; 0 on one), so "the client had nothing verified to prove" does not hold for most of them.

    A next step that would settle it: run one pull with -vv and capture the client's view of the first proof on the stalled lane.

    Cost. In run 1 the remainders waited for a busy lane (waiting=3/10/20). The run still took 619 s, inside the 497–659 s baseline.

    🤖 Generated with Claude Code

  6. removed their assignment
    on Oct 1, 2026
  7. 2 remaining items

  8. thiras commented on Oct 2, 2026

    @thiras
    ContributorAuthor

    All four items are fixed.

    1. Logging lane faults: fix(client,cli): log each lane fault where it happens and grow a busy lane for its remainder #2231.

    2. Proof-stall debug line: fix(client,cli): log each lane fault where it happens and grow a busy lane for its remainder #2231. fix(client,cli): keep the bundle task polled while records and fsyncs run #2274 adds phase=\"first_frame\" for a fresh leg's wait for its first frame.

    3. Handing a faulted remainder to another lane: fix(client,cli): retry lane growth until a faulted remainder finds a stream #2273. Growth retries until the remainder finds a stream, and a lane gives its permit back when its own worker ends. A busy lane can grow, by pull-through, for a range no running lane covers. A lane that refuses pull-through is barred, and refused extra streams back off. ADR 039 is updated to match.

    4. Root cause of the proof gap: the node started its 10 s proof clock once up to about 9.5 MiB sat in its QUIC send buffer (noq's default send window is 10 MB per connection), not once the client had the bytes. fix(node): wait out a proof while the stream's bytes still drain #2272 and fix(node): bound the proof wait on time and classify its faults #2287 change that.

      • A proof wait now faults after 10 s with no new STREAM frame on the connection, and one owed chunk is held for at most 30 s in total.
      • The fault carries the measured times and the selected path's stats (relay or direct, IPv4 or IPv6, RTT, cwnd, losses).
      • A chunk that hits the ceiling is no longer counted as a client abandon.

      fix(client,cli): keep the bundle task polled while records and fsyncs run #2274 removes the client-side freeze that made all lanes miss their proofs together.

    If a live pull shows proof-1 faults again, the fault text now names the path and the measured gap. Reopen with that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:cliarea:paymentskind:bug

Type

No type

Fields

Priority

None yet

Projects

  • Status
    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions