Skip to content

Refactor QUIC client to reuse connection for multiple streams - #1983

Merged
gaius-qi merged 1 commit into
mainfrom
feature/conn
Aug 12, 2026
Merged

gaius-qi merged 1 commit into
mainfrom
feature/conn

Conversation

@gaius-qi

Copy link
Copy Markdown
Member

Description

Previously a new QUIC connection (and endpoint) was created for every single request. Now QUICClient holds a single Connection established at construction time, and each download request opens a new bi-directional stream over that shared connection. The client pool checks whether the connection is still alive before reusing an entry, and recreates it when the connection has been closed. The send half of each stream is now explicitly finished so the request is delivered reliably. Internal helper methods are renamed from read_/connect_and_write_request to recv_/send_request to better reflect their role.

Related Issue

Motivation and Context

Screenshots (if appropriate)

… all streams

Previously a new QUIC connection (and endpoint) was created for every
single request. Now QUICClient holds a single Connection established at
construction time, and each download request opens a new bi-directional
stream over that shared connection. The client pool checks whether the
connection is still alive before reusing an entry, and recreates it when
the connection has been closed. The send half of each stream is now
explicitly finished so the request is delivered reliably. Internal
helper methods are renamed from read_*/connect_and_write_request to
recv_*/send_request to better reflect their role.

Signed-off-by: Gaius <gaius.qi@gmail.com>
@gaius-qi gaius-qi added this to the v2.6.0 milestone Aug 12, 2026
@gaius-qi gaius-qi self-assigned this Aug 12, 2026
@gaius-qi
gaius-qi requested review from a team as code owners August 12, 2026 08:16
@gaius-qi gaius-qi added the enhancement New feature or request label Aug 12, 2026
@github-actions
github-actions Bot requested review from fcgxz2003 and jim3ma August 12, 2026 08:16
@gaius-qi
gaius-qi enabled auto-merge (squash) August 12, 2026 08:16

@chlins chlins left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@gaius-qi
gaius-qi merged commit ada8049 into main Aug 12, 2026
8 of 9 checks passed
@gaius-qi
gaius-qi deleted the feature/conn branch August 12, 2026 08:20
@codecov

codecov Bot commented Aug 12, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 48 lines in your changes missing coverage. Please review.
✅ Project coverage is 51.77%. Comparing base (588facf) to head (2e46f44).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
dragonfly-client-storage/src/client/quic.rs 0.00% 39 Missing ⚠️
dragonfly-client/src/resource/piece_downloader.rs 0.00% 5 Missing ⚠️
dragonfly-client-storage/src/client/tcp.rs 0.00% 4 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1983      +/-   ##
==========================================
- Coverage   51.80%   51.77%   -0.04%     
==========================================
  Files         100      100              
  Lines       27161    27189      +28     
==========================================
+ Hits        14071    14076       +5     
- Misses      13090    13113      +23     
Files with missing lines Coverage Δ
dragonfly-client-storage/src/client/tcp.rs 0.00% <0.00%> (ø)
dragonfly-client/src/resource/piece_downloader.rs 52.85% <0.00%> (-4.07%) ⬇️
dragonfly-client-storage/src/client/quic.rs 18.02% <0.00%> (-3.21%) ⬇️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

entrop-tankos pushed a commit to entrop-tankos/client-backtosource that referenced this pull request Sep 21, 2026
…flyoss#1983)

refactor(quic): establish connection once per client and reuse it for all streams

Previously a new QUIC connection (and endpoint) was created for every
single request. Now QUICClient holds a single Connection established at
construction time, and each download request opens a new bi-directional
stream over that shared connection. The client pool checks whether the
connection is still alive before reusing an entry, and recreates it when
the connection has been closed. The send half of each stream is now
explicitly finished so the request is delivered reliably. Internal
helper methods are renamed from read_*/connect_and_write_request to
recv_*/send_request to better reflect their role.

Signed-off-by: Gaius <gaius.qi@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants