From f0629df29a3e176c6d6e6d42c80025c4426c6866 Mon Sep 17 00:00:00 2001 From: whx <1142597859@qq.com> Date: Thu, 21 Jul 2022 23:53:26 +0800 Subject: [PATCH] fix issue#359: SocketTimeoutException(connect time out) is not judged as a ConnectionException #359 --- .../java/com/netflix/client/RequestSpecificRetryHandler.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ribbon-core/src/main/java/com/netflix/client/RequestSpecificRetryHandler.java b/ribbon-core/src/main/java/com/netflix/client/RequestSpecificRetryHandler.java index 438191f29..3ac4736e9 100644 --- a/ribbon-core/src/main/java/com/netflix/client/RequestSpecificRetryHandler.java +++ b/ribbon-core/src/main/java/com/netflix/client/RequestSpecificRetryHandler.java @@ -1,6 +1,7 @@ package com.netflix.client; import java.net.SocketException; +import java.net.SocketTimeoutException; import java.util.List; import javax.annotation.Nullable; @@ -25,7 +26,7 @@ public class RequestSpecificRetryHandler implements RetryHandler { private final boolean okToRetryOnAllErrors; protected List> connectionRelated = - Lists.>newArrayList(SocketException.class); + Lists.>newArrayList(SocketException.class, SocketTimeoutException.class); public RequestSpecificRetryHandler(boolean okToRetryOnConnectErrors, boolean okToRetryOnAllErrors) { this(okToRetryOnConnectErrors, okToRetryOnAllErrors, RetryHandler.DEFAULT, null);