Skip to content

multi: support mark conncache as stale when network change #17246

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

Cering
Copy link
Contributor

@Cering Cering commented May 3, 2025

this PR is for fix #17225

curl_multi_setopt add a CURLMOPT_CONNCACHE_STALE option for network changing.

If set CURLMOPT_CONNCACHE_STALE to 1, libcurl ignore all connections in pool that were created earlier than Curl_now() when MSTATE_CONNECT state, in order to prevent their reuse(because these old connections were invalid).

@bagder bagder added the feature-window A merge of this requires an open feature window label May 3, 2025
@bagder
Copy link
Member

bagder commented May 3, 2025

Thanks! Here are some good next steps:

  1. Update docs/libcurl/symbols-in-version
  2. Provide at least one test case that shows the feature working
  3. Add documentation so that we can verify that the code seems to work as documented and vice versa

@testclutch
Copy link

Analysis of PR #17246 at 3db12794:

Test 1119 failed, which has NOT been flaky recently, so there could be a real issue in this PR. Note that this test has failed in 540 different CI jobs (the link just goes to one of them).

Test 284 failed, which has NOT been flaky recently, so there could be a real issue in this PR.

Test 2301 failed, which has NOT been flaky recently, so there could be a real issue in this PR.

Test 2302 failed, which has NOT been flaky recently, so there could be a real issue in this PR.

Test 2101 failed, which has NOT been flaky recently, so there could be a real issue in this PR.

Test 987 failed, which has NOT been flaky recently, so there could be a real issue in this PR.

Test 988 failed, which has NOT been flaky recently, so there could be a real issue in this PR.

There are more failures, but that's enough from Gha.

Generated by Testclutch

@Cering
Copy link
Contributor Author

Cering commented May 7, 2025

Thanks! Here are some good next steps:

  1. Update docs/libcurl/symbols-in-version
  2. Provide at least one test case that shows the feature working
  3. Add documentation so that we can verify that the code seems to work as documented and vice versa

Done, please check the follow up commits.

@Cering Cering force-pushed the dev branch 3 times, most recently from de7d76c to 251a3c6 Compare May 8, 2025 14:06
@github-actions github-actions bot added the tests label May 8, 2025
@Cering Cering force-pushed the dev branch 6 times, most recently from a0c31bc to e41ff52 Compare May 8, 2025 15:18
@bagder
Copy link
Member

bagder commented May 13, 2025

I have a proposal for solving this slightly differently:

We introduce a new value to the existing CURLOPT_FRESH_CONNECT option. Currently this option uses the value 1 and means that this transfer should not reuse any existing connection. The current option basically just side-steps the existing connection cache.

What if we introduce a new value, (2) that means what when this transfer starts, it also marks all currently alive connections as not-for-reuse ? Because this functionality is so close to the existing option, I figure it might be an idea to use the same option and not having to create a new one.

@icing
Copy link
Contributor

icing commented May 16, 2025

What if we introduce a new value, (2) that means what when this transfer starts, it also marks all currently alive connections as not-for-reuse ? Because this functionality is so close to the existing option, I figure it might be an idea to use the same option and not having to create a new one.

I like that.

@Cering
Copy link
Contributor Author

Cering commented May 22, 2025

What if we introduce a new value, (2) that means what when this transfer starts, it also marks all currently alive connections as not-for-reuse ? Because this functionality is so close to the existing option, I figure it might be an idea to use the same option and not having to create a new one.

Oh, I have modified it: if set CURLOPT_FRESH_CONNECT=2, libcurl not only create a new connection for the current request, but also clear all existing connections in pool, for preventing follow-up requests reuse them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-window A merge of this requires an open feature window libcurl API tests
Development

Successfully merging this pull request may close these issues.

connection reuse lead to continuous timout after network changed
4 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy