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

Connection timeout the double of what is configured #4811

Merged
merged 3 commits into from
Jul 3, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import java.lang.reflect.Field;
import java.net.HttpURLConnection;
import java.net.ProtocolException;
import java.net.SocketTimeoutException;
import java.net.URI;
import java.net.URISyntaxException;
import java.security.AccessController;
Expand Down Expand Up @@ -541,7 +542,11 @@ private IOException handleException(ClientRequest request, IOException ex, HttpU
if (connectorExtension.handleException(request, uc, ex)) {
return null;
}
if (uc.getResponseCode() == -1) {
/*
* uc.getResponseCode triggers another request. If we already know it is a SocketTimeoutException
* we can throw the exception directly. Otherwise the request will be 2 * timeout.
*/
if (ex instanceof SocketTimeoutException || uc.getResponseCode() == -1) {
throw ex;
} else {
return ex;
Expand Down