-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Timeout is effectively half of what it should be #1883
Comments
It took me several hours today to find out why the timeout was always 30 seconds, even though I had set it to 60 seconds. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If I create a connection with a 30s timeout (e.g.
Jsoup.connect().timeout(30000)
), this allows:All three should allow up to 30s.
The 15s anomaly is due to
conn.setReadTimeout(req.timeout() / 2);
I understand that if you did
conn.setConnectTimeout(30000)
andconn.setReadTimeout(30000)
, then it might be 60s before the request completes, provided the webserver deliberately waited 29.999s before allowing the connection to open... but this is not fixed by halving the initial read timeout, it just reduces it to 45s (15s over the configured timeout).I'd say it was much more common that connection is established quickly, then the web server takes its time servicing the request, only starting its response after several seconds of work. I'd like to say
conn.timeout(30000)
to allow the webserver 30s of time to do something with my request before giving any response. I don't want it to have a timeout after 15s (after the connection was established in 0.001s)The text was updated successfully, but these errors were encountered: