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
Disable signals in libcurl. #2226
Conversation
TIL: libcurl uses signals to perform timeouts by default. This change disables the signals for all the handles we create, per the documentation on: https://curl.haxx.se/libcurl/c/CURLOPT_NOSIGNAL.html I will try to write a regression test later, though it might be hard because it requires "waiting for a couple of minutes" to get the signal. In any case, given the documentation, and the fact that there is a bug report (googleapis#2225) associated with this, I believe we should incorporate these fixes.
58caa83
to
f51f173
Compare
@nickolasrossi if you have a few minutes to spare: I added an integration test to this PR that I hoped would reproduce the problem. Alas! It does not. Any suggestions on what to change would be great. |
Codecov Report
@@ Coverage Diff @@
## master #2226 +/- ##
==========================================
+ Coverage 91.99% 92.49% +0.49%
==========================================
Files 307 307
Lines 18402 18430 +28
==========================================
+ Hits 16929 17046 +117
+ Misses 1473 1384 -89
Continue to review full report at Codecov.
|
Yeah, it’s tough to repro an intermittent problem... since it comes from a DNS timeout, I think you want to download from a host name that causes DNS to take a while, and set a small CURLOPT_TIMEOUT to make it time out faster. |
That's a good suggestion. What do you think about something similar to this? |
I created a clean PR with just the fixes, closing this for now. If/When I can create a regression test I will submit a separate PR. |
TIL: libcurl uses signals to perform timeouts by default. This change
disables the signals for all the handles we create, per the
documentation on:
https://curl.haxx.se/libcurl/c/CURLOPT_NOSIGNAL.html
I will try to write a regression test later, though it might be hard
because it requires "waiting for a couple of minutes" to get the
signal.
In any case, given the documentation, and the fact that there is a bug
report (#2225) associated with this, I believe we should incorporate
these fixes.
This change is