conn upkeep/alive: move and enhance - #21806
Closed
icing wants to merge 1 commit into
Closed
Conversation
bagder
approved these changes
Jun 1, 2026
There was a problem hiding this comment.
Pull request overview
This PR refactors connection “dead/alive” detection and connection upkeep so the logic lives with the connection pool (conncache), and adds behavior to terminate unused connections when upkeep fails.
Changes:
- Move “connection seems dead” logic from
url.cintoconncache.casCurl_cpool_conn_seems_dead(), and update call sites. - Inline/move connection upkeep logic into
conncache.cand terminate non-in-use connections when upkeep returns an error. - Simplify
Curl_conn_keep_alive()to upkeep all sockets of a connection (removessockindexparameter).
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/url.h | Removes prototypes for functions moved out of url layer. |
| lib/url.c | Switches dead-connection checks to the new cpool helper. |
| lib/conncache.h | Declares the new Curl_cpool_conn_seems_dead() API. |
| lib/conncache.c | Implements dead-check in conncache and enhances upkeep to terminate failed idle conns. |
| lib/cfilters.h | Updates Curl_conn_keep_alive() signature (drops sockindex). |
| lib/cfilters.c | Implements new Curl_conn_keep_alive() behavior over both sockets. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Member
|
@icing this has a conflict now! |
icing
force-pushed
the
conn-upkeep-alives
branch
from
June 26, 2026 12:52
90b936f to
cc24176
Compare
Contributor
Author
|
Rebased on current master. |
Member
|
@icing this old one is now out of sync again, should we get this one merged? |
icing
force-pushed
the
conn-upkeep-alives
branch
from
July 27, 2026 07:49
cc24176 to
2fce1a9
Compare
- move `Curl_conn_seems_dead()` into conncache.c - move `Curl_conn_upkeep()` into conncache.c - when upkeep gives an error on a connection not in use, terminate it
icing
force-pushed
the
conn-upkeep-alives
branch
from
July 27, 2026 09:17
2fce1a9 to
ceb1cff
Compare
bagder
approved these changes
Jul 27, 2026
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.
Curl_conn_seems_dead()into conncache.cCurl_conn_upkeep()into conncache.c