-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
CONNECT_ONLY connections can get closed when cache is full #4369
Comments
I don't see how this is a bug. This seems to work exactly as intended:
Where is the error here? |
I have just set the cache size to one to make this easier to reproduce. But I've experienced this even with default setting. It behaves exactly as you described. The problem is the CONNECT_ONLY connections with extracted socket using CURLINFO_ACTIVESOCKET probably should not be closed (until curl_easy_cleanup is called). As this makes extracted socket unusable. |
The error here is probably that the connection should be treated as in use and thus shouldn't be considered for closing. |
This makes them never to be considered "the oldest" to be discarded when reaching the connection cache limit. The reasoning here is that CONNECT_ONLY is primarily used in combination with using the connection's socket post connect and since that is used outside of curl's knowledge we must assume that it is in use until explicitly closed. Reported-by: Pavel Pavlov Reported-by: Pavel Löbl Fixes #4426 Fixes #4369
Yes. I cannot reproduce it with that change anymore. Thanks |
There was a discussion recently about connection cache and CONNECT_ONLY connections. in this issue #3983 (comment)_ . And I think I've just hit the same thing.
I use CONNECT_ONLY to establish the connection and then put filedescriptor in own event loop to do some websocket communication. Recently I've noticed that sometimes connection is closed when it's returned to cache. I think this makes CURLINFO_ACTIVESOCKET unusable since Curl_conncache_return_conn does not consider CONNECT_ONLY connection as in use.
Here an example to reproduce the issue.
The text was updated successfully, but these errors were encountered: