Skip to content
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

Timeouts in Julia 1.7.2 (due to setopt(easy, CURLOPT_LOW_SPEED_TIME, 20) in new Downloads.jl) #22

Closed
manuelbb-upb opened this issue Apr 28, 2022 · 1 comment

Comments

@manuelbb-upb
Copy link

After upgrading from Julia 1.6.1 to Julia 1.7.2, I noticed that some of my requests would fail with

gRPCServiceCallException: 4, Deadline expired before the operation could complete

for tasks with a long response time.
The error persisted for any combination of request_timeout and connection_timeout values.
Setting maxage did completely stall everything.

I believe that the error is due to a version jump of the "Downloads" package.
In my case it went from 1.4.0 to 1.5.2.
I think this line is responsible, which sets

setopt(easy, CURLOPT_LOW_SPEED_TIME, 20)

This seems to be due to JuliaLang/Downloads.jl#126 which was merged into all versions of Downloads >= 1.4.1.

I have put

Curl.setopt(easy, CURLOPT_LOW_SPEED_TIME, Clong(0))

at the beginning of set_connect_timeout() in src/curl.jl and the error is gone.

So as a fix I would propose to expose the option as an additional keyword argument, i.e., low_speed_time, with a default value of 0.

@tanmaykm
Copy link
Member

There were existing tests for request timeout handling. There's now a test for connect timeouts, which runs successfully.

Actually from CURL docs it seems that the default value of CURLOPT_LOW_SPEED_TIME and CURLOPT_LOW_SPEED_LIMIT are 0, meaning that they are disabled. So the only timeout that should be effective is the request_timeout (and connection_timeout if connect is slow). So looks like it is not necessary to specify these to get the behavior we need.

I believe the actual issue here was something else, most likely what got fixed by #26

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants