Skip to content

client: StreamCandidate::lease is released after the first target of a multi-target Downloader fetch #2214

Closed

Description

@thiras

Summary

StreamCandidate::lease (decdn-client, added in #2212) is released when the candidate's lane stops in its first fetch. A Downloader given several DownloadTargets builds new SourceLanes from the same candidates for every target (source_lanes, called once per target). So every target after the first runs with the lease already released, and nothing warns about it.

Impact

None today: bundle pull leases candidates only on single-target fetches (fetch::multi_source_download). The only guard is the field's doc ("set it only on a single-target fetch"). A future multi-target caller that holds a stream permit in a lease would silently exceed --max-lane-streams from the second target on.

Options

  • Make the lease a per-fetch argument keyed by lane, instead of a candidate field. multi_source_download already builds a HashMap<Address, LaneLease>.
  • Or have Downloader reject a non-empty lease when it is given more than one target.

Pre-launch, so the public API change is fine.

Activity

  1. added
    kind:bug
    on Sep 28, 2026
  2. self-assigned this
    on Sep 28, 2026
  3. added
    rust
    area:cli
    on Sep 28, 2026
  4. added
    prio:low
    on Sep 28, 2026
  5. removed their assignment
    on Sep 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:clikind:bugprio:lowrust

Type

No type

Fields

Priority

None yet

Projects

  • Status
    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions