-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
Curl_conncache_remove_conn: Assertion `!(data)->state.conncache_lock' failed #4029
Comments
Thanks, although I propose a different fix in #4032 that I think actually simplifies the code overall. |
Thanks. Ok, let me write up a test case that verifies the correct behavior and I'll check. Maybe I messed up here... |
My little example maxage-conn.c seems to work as presumed both with and without the #4032 PR. I set the maximum age to one second and after a two second sleep the next transfer won't reuse the connection since it is now too old. |
Above example doesn't seem to have CURLOPT_SHARE, would it be possible for you to try a run with example I provided in initial request? |
PS the test 188 failures we see in my #4032 PR is an unrelated bug that's being fixed in #4034 |
mybad, subsequent program to test was not linking to correct library, verified with correct one, so we are good. Thanks. |
I did this
The test case involves sequential HTTP transfer with timeout period in between which should result in closing existing connection. Its using CURLOPT_SHARE and CURLDEBUG(debug build:--enable-debug --enable-curldebug).
Following is the sample program to simulate the issue:
https://gist.github.com/kunalekawde/fa8915cf5dbcac3148501119e30d8f63
I expected the following
Sequential HTTP transfers to complete without assertion.
curl/libcurl version
curl 7.65.1
Since the issue was seen in master, I could isolate it to 1 fix after 7.65.1
f67009d for the pull: #4013
To reproduce please use: 7.65.1 + 4013(as mentioned above), other latest from curl master can also be used.
operating system
Fedora 28
observation
As with debug build, there are assertions during CONN_LOCK and CONN_UNLOCK for double lock and lock/unlock without existing unlock/lock on same respectively.
After a lot of playing around, learnt that its when CURLOPT_SHARE is used along with debug build.
In this testcase flow its observed at connection is being locked during disconnection due to max age of the connection which is already holding the lock.
fix
https://gist.github.com/kunalekawde/34c73ee19aabd2281c2a2abd915ea00a
Although the fix is working for the case there could be better or other places affected, request to please address or if the fix is fine, let me know if should pull this to master.
The text was updated successfully, but these errors were encountered: