Repository navigation
fix(backend): set the connect timeout of the http client - #2202
Merged
Merged
Conversation
chlins
requested review from
ClementMaH,
Zephyrcf,
bergwolf,
fcgxz2003,
hhhhsdxxxx and
mingcheng
December 1, 2026 08:46
The http backend had no connect timeout, so the source stat waited for the kernel SYN retries (about 127s) when the source was unreachable, longer than containerd waits (30s), and the proxy never fell back to the parents. Signed-off-by: Chlins Zhang <chlins.zhang@gmail.com>
chlins
force-pushed
the
fix/backend-connect-timeout
branch
from
December 1, 2026 08:47
7b2f7d3 to
5078c2e
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2202 +/- ##
==========================================
- Coverage 67.09% 67.08% -0.01%
==========================================
Files 102 102
Lines 33018 33060 +42
==========================================
+ Hits 22152 22177 +25
- Misses 10866 10883 +17
🚀 New features to boost your workflow:
|
Member
Author
|
e2e on a 50 node cluster (scheduler with redis, manifest tag cache on), a fresh node pulls by the tag and another by the digest while the peers have the image:
|
Relocate `DEFAULT_CONNECT_TIMEOUT` from the HTTP backend into the shared lib module alongside other connection-related constants, so it can be reused across backend implementations instead of being tied to the HTTP backend only. Update references and tests accordingly. Signed-off-by: Gaius <gaius.qi@gmail.com>
Signed-off-by: Chlins Zhang <chlins.zhang@gmail.com>
gaius-qi
enabled auto-merge (squash)
December 2, 2026 03:08
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Set a 5s connect timeout on both reqwest clients of the http backend (the default one and the one for the client certificate). Same as the proxy's
DEFAULT_PROXY_TIMEOUT.Add a test that stats a server with a full accept queue. It took 30s before and 5s after.
Related Issue
dragonflyoss/dragonfly#5116
Motivation and Context
Without a connect timeout, the source stat in
Task::download_startedwaits for the kernel SYN retries (about 127s) when the registry is unreachable. containerd gives up after 30s (ResponseHeaderTimeout), so the proxy never falls back to the parents and the pull fails even though the peers have the image.Found in an e2e test with the network to the registry dropping every packet. A registry that accepts the connection and never answers is not covered here.