Skip to content

Commit

Permalink
Connection timeout the double of what is configured
Browse files Browse the repository at this point in the history
Signed-off-by: Jorge Bescos Gascon <[email protected]>
  • Loading branch information
jbescos committed Jul 2, 2021
1 parent f8ed0de commit f46f602
Showing 1 changed file with 6 additions and 1 deletion.
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

0 comments on commit f46f602

Please sign in to comment.