Skip to content

bundle pull: a restarting lane worker wins every freed provider permit, so a sibling entry's queued range waits minutes #2341

Closed

Description

@thiras

Summary

In bundle pull, the entries share each provider's --max-lane-streams permits, and they get them first-come. A lane's own worker starts again on GrowFor::Restart, which can take the provider's last free permit. An extra stream for another entry's queued range asks with GrowFor::Extra, which needs two free permits (keep = 1, bundle_pull.rs ExtraPermits::grant ~2002). The extra-stream ask runs at most once per growth pass (GROWTH_RETRY = 1 s). A worker that ends a short leg restarts in the same instant. So an entry with many short legs on a provider keeps all of that provider's permits, and a sibling entry's queued range on the same provider waits for minutes.

Evidence (testnet, 2026-10-06 16:41–16:54 UTC, CLI e416a1e3, fleet on the 2026-10-05 05:06 build)

decdn bundle pull --hash 9194000d… --namespace 1 (mistral), default --max-lane-streams 4, run with RUST_LOG=info,decdn_cli=debug,decdn_client=debug.

  • Entry 998030…: lane coverage at 16:41:39 was hel1 7-48,64-74, lon1 18-23,48, bcl 0-74. Only bcl covers groups 49–63, the range 3288334336+1006632960 (1 GB).
  • That range waited 450 s with refused=1 no_candidate=0 (a queued range waits for a stream, logged at 90 s, 270 s and 450 s).
  • From 16:41:39 to 16:49:29, the client opened 54 legs to bcl: 50 for 7cbb48… (the range-dedup complement, 3–50 MB legs), 3 for ad7f7e…, 1 for 998030…. 19 of those were a busy lane takes one extra stream grants to bcl.
  • The 1 GB range opened on bcl at 16:49:29. As one stream at ~3.4 MB/s, it ended at 16:54:24. The run took 12m57s.

Impact

In this run, the bcl→client path was slow (bcl NIC tx 2–6 MB/s, serve spans 96–98% idle), and all bcl-only work had to pass through bcl's 4 permits. 998030 and 7cbb48 ended 8 s apart. So the starvation changed the order in which bcl's work ran, not the total time. It costs time when the starved range is the critical path and the other entry's legs are not. Here it also put the largest piece of bcl-only work last, as one stream, which is the worst order for the tail.

Direction (not decided)

  • Give a queued range that waits for a provider's permit a claim on the next permit that is released, instead of a try_acquire race against a restarting worker.
  • Or let a Restart honour the same keep as an Extra while another entry has a range queued on that provider.

Related

#2208 (whole-entry permits starved a proxy lane to width 1), #2252 (the complement drains as serial legs to one holder).

Activity

  1. added
    kind:bug
    rust
    area:cli
    on Oct 6, 2026
  2. thiras commented on Oct 6, 2026

    @thiras
    ContributorAuthor

    Data point: the same pull with --max-lane-streams 8 at 16:56–17:02 UTC took 6m07s (0 failed). No queued range waited more than 9 s (998030 max 2 s), against 450 s at the default 4. The client granted 137 extra streams. No node logged a stream-cap, signer-cap or load-shed refusal.

    This is confounded: the bcl→client path had recovered by then (bcl served ~16 MB/s against 2–6 MB/s in the 12m57s run). So it shows that a wider cap removes the wait, not how much time the wait costs.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:clikind:bugrust

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    • Status
      Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions