Repository: huaweicloud/sermant
Issue: 【bug】fix the registry plugin bugs

### What happened?

can not work

### How can we reproduce it (as minimally and precisely as possible)?

no

### Anything else we need to know?

_No response_

### Sermant version

<details>
0.6.0
</details>


### OS version

<details>

```console
# On Linux:
$ cat /etc/os-release
# paste output here
$ uname -a
# paste output here

# On Windows:
C:\\> wmic os get Caption, Version, BuildNumber, OSArchitecture
# paste output here
```
</details>


Changed files:
sermant-plugins/sermant-springboot-registry/springboot-registry-plugin/src/main/java/com/huawei/discovery/interceptors/httpclient/HttpAsyncClient4xInterceptor.java
sermant-plugins/sermant-springboot-registry/springboot-registry-service/src/test/java/com/huawei/discovery/service/lb/stats/InstanceStatsTest.java
sermant-plugins/sermant-springboot-registry/springboot-registry-plugin/src/main/java/com/huawei/discovery/utils/RequestInterceptorUtils.java
sermant-plugins/sermant-springboot-registry/springboot-registry-service/src/main/java/com/huawei/discovery/service/lb/stats/InstanceStats.java
sermant-plugins/sermant-springboot-registry/springboot-registry-plugin/src/main/java/com/huawei/discovery/entity/SimpleRequestRecorder.java
sermant-plugins/sermant-springboot-registry/springboot-registry-plugin/src/main/java/com/huawei/discovery/interceptors/OkHttpClientInterceptor.java
sermant-plugins/sermant-springboot-registry/springboot-registry-plugin/src/main/java/com/huawei/discovery/retry/DefaultRetryImpl.java
sermant-plugins/sermant-springboot-registry/springboot-registry-plugin/src/main/java/com/huawei/discovery/interceptors/OkHttp3ClientInterceptor.java
sermant-plugins/sermant-springboot-registry/springboot-registry-service/src/main/java/com/huawei/discovery/service/retry/RetryServiceImpl.java
sermant-plugins/sermant-springboot-registry/springboot-registry-plugin/src/main/java/com/huawei/discovery/config/LbConfig.java
sermant-plugins/sermant-springboot-registry/springboot-registry-plugin/src/main/java/com/huawei/discovery/config/LbConstants.java

diff --git a/sermant-plugins/sermant-springboot-registry/springboot-registry-plugin/src/main/java/com/huawei/discovery/config/LbConfig.java b/sermant-plugins/sermant-springboot-registry/springboot-registry-plugin/src/main/java/com/huawei/discovery/config/LbConfig.java
index 72f1627e..de1eb957 100644
--- a/sermant-plugins/sermant-springboot-registry/springboot-registry-plugin/src/main/java/com/huawei/discovery/config/LbConfig.java
+++ b/sermant-plugins/sermant-springboot-registry/springboot-registry-plugin/src/main/java/com/huawei/discovery/config/LbConfig.java
@@ -135,9 +135,9 @@ public class LbConfig implements PluginConfig {
     private boolean preferIpAddress = false;
 
     /**
-     * 统计并发数的时间窗口, 默认10分钟, 并发数仅在时间窗口内统计生效, 超出则清0
+     * 实例状态统计时间窗口, 默认10分钟, 每一个时间窗口的开始, 统计都会清0
      */
-    private long activeRequestTimeoutWindowMs = LbConstants.DEFAULT_ACTIVE_REQUEST_COUNT_WINDOW_MS;
+    private long instanceStatTimeWindowMs = LbConstants.DEFAULT_INSTANCE_STATE_TIME_WINDOW_MS;
 
     public long getRefreshTimerInterval() {
         return refreshTimerInterval;
@@ -187,8 +187,8 @@ public class LbConfig implements PluginConfig {
         this.zkServerVersion = version;
     }
 
-    public long getActiveRequestTimeoutWindowMs() {
-        return activeRequestTimeoutWindowMs;
+    public long getInstanceStatTimeWindowMs() {
+        return instanceStatTimeWindowMs;
     }
 
     public int getMaxRetryConfigCache() {
@@ -199,8 +199,8 @@ public class LbConfig implements PluginConfig {
         this.maxRetryConfigCache = maxRetryConfigCache;
     }
 
-    public void setActiveRequestTimeoutWindowMs(long activeRequestTimeoutWindowMs) {
-        this.activeRequestTimeoutWindowMs = activeRequestTimeoutWindowMs;
+    public void setInstanceStatTimeWindowMs(long instanceStatTimeWindowMs) {
+        this.instanceStatTimeWindowMs = instanceStatTimeWindowMs;
     }
 
     public String getZkUriSpec() {
diff --git a/sermant-plugins/sermant-springboot-registry/springboot-registry-plugin/src/main/java/com/huawei/discovery/config/LbConstants.java b/sermant-plugins/sermant-springboot-registry/springboot-registry-plugin/src/main/java/com/huawei/discovery/config/LbConstants.java
index 64beed89..c7e8fa86 100644
--- a/sermant-plugins/sermant-springboot-registry/springboot-registry-plugin/src/main/java/com/huawei/discovery/config/LbConstants.java
+++ b/sermant-plugins/sermant-springboot-registry/springboot-registry-plugin/src/main/java/com/huawei/discovery/config/LbConstants.java
@@ -64,9 +64,9 @@ public class LbConstants {
     public static final long DEFAULT_LB_STATS_REFRESH_INTERVAL_MS = 30000L;
 
     /**
-     * 统计并发数的时间窗口, 默认10分钟
+     * 实例状态统计时间窗口, 默认10分钟, 每一个时间窗口的开始, 统计都会清0
      */
-    public static final long DEFAULT_ACTIVE_REQUEST_COUNT_WINDOW_MS = 600000L;
+    public static final long DEFAULT_INSTANCE_STATE_TIME_WINDOW_MS = 600000L;
 
     /**
      * 服务超时后最大重试次数
diff --git a/sermant-plugins/sermant-springboot-registry/springboot-registry-plugin/src/main/java/com/huawei/discovery/entity/SimpleRequestRecorder.java b/sermant-plugins/sermant-springboot-registry/springboot-registry-plugin/src/main/java/com/huawei/discovery/entity/SimpleRequestRecorder.java
index 2ff7d40f..13274605 100644
--- a/sermant-plugins/sermant-springboot-registry/springboot-registry-plugin/src/main/java/com/huawei/discovery/entity/SimpleRequestRecorder.java
+++ b/sermant-plugins/sermant-springboot-registry/springboot-registry-plugin/src/main/java/com/huawei/discovery/entity/SimpleRequestRecorder.java
@@ -55,7 +55,7 @@ public class SimpleRequestRecorder implements Recorder {
         }
         if (discoveryPluginConfig.isEnableRequestCount()) {
             LOGGER.info(String.format(Locale.ENGLISH,
-                            "currentTime: %s httpClientInterceptor effect count: %s",
+                            "currentTime: %s request count handle by plugin is: %s",
                     HttpConstants.currentTime(), allRequest));
         }
     }
diff --git a/sermant-plugins/sermant-springboot-registry/springboot-registry-plugin/src/main/java/com/huawei/discovery/interceptors/OkHttp3ClientInterceptor.java b/sermant-plugins/sermant-springboot-registry/springboot-registry-plugin/src/main/java/com/huawei/discovery/interceptors/OkHttp3ClientInterceptor.java
index 43759e24..8fb1c39c 100644
--- a/sermant-plugins/sermant-springboot-registry/springboot-registry-plugin/src/main/java/com/huawei/discovery/interceptors/OkHttp3ClientInterceptor.java
+++ b/sermant-plugins/sermant-springboot-registry/springboot-registry-plugin/src/main/java/com/huawei/discovery/interceptors/OkHttp3ClientInterceptor.java
@@ -26,6 +26,7 @@ import com.huawei.discovery.utils.RequestInterceptorUtils;
 import com.huaweicloud.sermant.core.common.LoggerFactory;
 import com.huaweicloud.sermant.core.plugin.agent.entity.ExecuteContext;
 import com.huaweicloud.sermant.core.plugin.service.PluginServiceManager;
+import com.huaweicloud.sermant.core.utils.ReflectUtils;
 
 import okhttp3.HttpUrl;
 import okhttp3.Protocol;
@@ -37,6 +38,7 @@ import org.apache.http.HttpStatus;
 
 import java.net.URI;
 import java.util.Map;
+import java.util.Optional;
 import java.util.concurrent.atomic.AtomicReference;
 import java.util.function.Function;
 import java.util.logging.Logger;
@@ -48,7 +50,6 @@ import java.util.logging.Logger;
  * @since 2022-09-14
  */
 public class OkHttp3ClientInterceptor extends MarkInterceptor {
-
     private static final Logger LOGGER = LoggerFactory.getLogger();
 
     private static final String FIELD_NAME = "originalRequest";
@@ -56,10 +57,11 @@ public class OkHttp3ClientInterceptor extends MarkInterceptor {
     @Override
     protected ExecuteContext doBefore(ExecuteContext context) throws Exception {
         final InvokerService invokerService = PluginServiceManager.getPluginService(InvokerService.class);
-        if (context.getRawMemberFieldValue(FIELD_NAME) == null) {
+        final Optional<Request> rawRequest = getRequest(context);
+        if (!rawRequest.isPresent()) {
             return context;
         }
-        Request request = (Request)context.getRawMemberFieldValue(FIELD_NAME);
+        Request request = rawRequest.get();
         URI uri = request.url().uri();
         Map<String, String> hostAndPath = RequestInterceptorUtils.recoverHostAndPath(uri.getPath());
         if (!PlugEffectWhiteBlackUtils.isAllowRun(uri.getHost(), hostAndPath.get(HttpConstants.HTTP_URI_HOST),
@@ -68,6 +70,7 @@ public class OkHttp3ClientInterceptor extends MarkInterceptor {
         }
         RequestInterceptorUtils.printRequestLog("OkHttp3", hostAndPath);
         AtomicReference<Request> rebuildRequest = new AtomicReference<>();
+        rebuildRequest.set(request);
         invokerService.invoke(
                 buildInvokerFunc(uri, hostAndPath, request, rebuildRequest, context),
                 buildExFunc(rebuildRequest),
@@ -76,6 +79,14 @@ public class OkHttp3ClientInterceptor extends MarkInterceptor {
         return context;
     }
 
+    private Optional<Request> getRequest(ExecuteContext context) {
+        final Optional<Object> originalRequest = ReflectUtils.getFieldValue(context.getObject(), FIELD_NAME);
+        if (originalRequest.isPresent() && originalRequest.get() instanceof Request) {
+            return Optional.of((Request) originalRequest.get());
+        }
+        return Optional.empty();
+    }
+
     private Function<Exception, Object> buildExFunc(AtomicReference<Request> rebuildRequest) {
         return ex -> buildErrorResponse(ex, rebuildRequest.get());
     }
diff --git a/sermant-plugins/sermant-springboot-registry/springboot-registry-plugin/src/main/java/com/huawei/discovery/interceptors/OkHttpClientInterceptor.java b/sermant-plugins/sermant-springboot-registry/springboot-registry-plugin/src/main/java/com/huawei/discovery/interceptors/OkHttpClientInterceptor.java
index 49e3e077..8266bcf5 100644
--- a/sermant-plugins/sermant-springboot-registry/springboot-registry-plugin/src/main/java/com/huawei/discovery/interceptors/OkHttpClientInterceptor.java
+++ b/sermant-plugins/sermant-springboot-registry/springboot-registry-plugin/src/main/java/com/huawei/discovery/interceptors/OkHttpClientInterceptor.java
@@ -26,6 +26,7 @@ import com.huawei.discovery.utils.RequestInterceptorUtils;
 import com.huaweicloud.sermant.core.common.LoggerFactory;
 import com.huaweicloud.sermant.core.plugin.agent.entity.ExecuteContext;
 import com.huaweicloud.sermant.core.plugin.service.PluginServiceManager;
+import com.huaweicloud.sermant.core.utils.ReflectUtils;
 
 import com.squareup.okhttp.HttpUrl;
 import com.squareup.okhttp.Protocol;
@@ -37,6 +38,7 @@ import org.apache.http.HttpStatus;
 
 import java.net.URI;
 import java.util.Map;
+import java.util.Optional;
 import java.util.concurrent.atomic.AtomicReference;
 import java.util.function.Function;
 import java.util.logging.Logger;
@@ -56,10 +58,11 @@ public class OkHttpClientInterceptor extends MarkInterceptor {
     @Override
     protected ExecuteContext doBefore(ExecuteContext context) throws Exception {
         final InvokerService invokerService = PluginServiceManager.getPluginService(InvokerService.class);
-        if (context.getRawMemberFieldValue(FIELD_NAME) == null) {
+        final Optional<Request> rawRequest = getRequest(context);
+        if (!rawRequest.isPresent()) {
             return context;
         }
-        Request request = (Request)context.getRawMemberFieldValue(FIELD_NAME);
+        Request request = rawRequest.get();
         URI uri = request.uri();
         Map<String, String> hostAndPath = RequestInterceptorUtils.recoverHostAndPath(uri.getPath());
         if (!PlugEffectWhiteBlackUtils.isAllowRun(uri.getHost(), hostAndPath.get(HttpConstants.HTTP_URI_HOST),
@@ -68,6 +71,7 @@ public class OkHttpClientInterceptor extends MarkInterceptor {
         }
         RequestInterceptorUtils.printRequestLog("OkHttp", hostAndPath);
         AtomicReference<Request> rebuildRequest = new AtomicReference<>();
+        rebuildRequest.set(request);
         invokerService.invoke(
                 buildInvokerFunc(uri, hostAndPath, request, rebuildRequest, context),
                 buildExFunc(rebuildRequest),
@@ -76,6 +80,14 @@ public class OkHttpClientInterceptor extends MarkInterceptor {
         return context;
     }
 
+    private Optional<Request> getRequest(ExecuteContext context) {
+        final Optional<Object> originalRequest = ReflectUtils.getFieldValue(context.getObject(), FIELD_NAME);
+        if (originalRequest.isPresent() && originalRequest.get() instanceof Request) {
+            return Optional.of((Request) originalRequest.get());
+        }
+        return Optional.empty();
+    }
+
     private Function<Exception, Object> buildExFunc(AtomicReference<Request> rebuildRequest) {
         return ex -> buildErrorResponse(ex, rebuildRequest.get());
     }
diff --git a/sermant-plugins/sermant-springboot-registry/springboot-registry-plugin/src/main/java/com/huawei/discovery/interceptors/httpclient/HttpAsyncClient4xInterceptor.java b/sermant-plugins/sermant-springboot-registry/springboot-registry-plugin/src/main/java/com/huawei/discovery/interceptors/httpclient/HttpAsyncClient4xInterceptor.java
index e2cb4c8a..9b88cc21 100644
--- a/sermant-plugins/sermant-springboot-registry/springboot-registry-plugin/src/main/java/com/huawei/discovery/interceptors/httpclient/HttpAsyncClient4xInterceptor.java
+++ b/sermant-plugins/sermant-springboot-registry/springboot-registry-plugin/src/main/java/com/huawei/discovery/interceptors/httpclient/HttpAsyncClient4xInterceptor.java
@@ -18,9 +18,7 @@ package com.huawei.discovery.interceptors.httpclient;
 
 import com.huawei.discovery.entity.FutureDecorator;
 import com.huawei.discovery.entity.HttpAsyncContext;
-import com.huawei.discovery.entity.Recorder;
 import com.huawei.discovery.entity.ServiceInstance;
-import com.huawei.discovery.entity.SimpleRequestRecorder;
 import com.huawei.discovery.retry.InvokerContext;
 import com.huawei.discovery.service.InvokerService;
 import com.huawei.discovery.utils.HttpAsyncUtils;
@@ -69,8 +67,6 @@ public class HttpAsyncClient4xInterceptor implements Interceptor {
 
     private final AtomicBoolean isLoaded = new AtomicBoolean();
 
-    private final Recorder recorder = new SimpleRequestRecorder();
-
     @Override
     public ExecuteContext before(ExecuteContext context) throws Exception {
         ready();
@@ -108,7 +104,6 @@ public class HttpAsyncClient4xInterceptor implements Interceptor {
             }
             RequestInterceptorUtils.printRequestLog("HttpAsyncClient", HttpAsyncUtils.getOrCreateContext()
                     .getHostAndPath());
-            recorder.beforeRequest();
             final Object result = context.getResult();
             if (!(result instanceof Future)) {
                 return context;
diff --git a/sermant-plugins/sermant-springboot-registry/springboot-registry-plugin/src/main/java/com/huawei/discovery/retry/DefaultRetryImpl.java b/sermant-plugins/sermant-springboot-registry/springboot-registry-plugin/src/main/java/com/huawei/discovery/retry/DefaultRetryImpl.java
index 43d58198..f16c0b73 100644
--- a/sermant-plugins/sermant-springboot-registry/springboot-registry-plugin/src/main/java/com/huawei/discovery/retry/DefaultRetryImpl.java
+++ b/sermant-plugins/sermant-springboot-registry/springboot-registry-plugin/src/main/java/com/huawei/discovery/retry/DefaultRetryImpl.java
@@ -18,8 +18,13 @@ package com.huawei.discovery.retry;
 
 import com.huawei.discovery.entity.Recorder;
 
+import com.huaweicloud.sermant.core.common.LoggerFactory;
+
+import java.util.Locale;
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.function.Predicate;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 
 /**
  * 默认重试器
@@ -28,6 +33,8 @@ import java.util.function.Predicate;
  * @since 2022-09-28
  */
 public class DefaultRetryImpl implements Retry {
+    private static final Logger LOGGER = LoggerFactory.getLogger();
+
     private final RetryConfig retryConfig;
 
     private final String name;
@@ -106,7 +113,13 @@ public class DefaultRetryImpl implements Retry {
             }
 
             // 抛出异常
-            throw new RetryException(ex);
+            if (invokeCount.get() > 0) {
+                LOGGER.log(Level.WARNING, String.format(Locale.ENGLISH, "Retry failed with %s times",
+                        invokeCount.get()), ex);
+            }
+            final RetryException retryException = new RetryException(ex);
+            retryException.setStackTrace(ex.getStackTrace());
+            throw retryException;
         }
 
         @Override
diff --git a/sermant-plugins/sermant-springboot-registry/springboot-registry-plugin/src/main/java/com/huawei/discovery/utils/RequestInterceptorUtils.java b/sermant-plugins/sermant-springboot-registry/springboot-registry-plugin/src/main/java/com/huawei/discovery/utils/RequestInterceptorUtils.java
index 08c8be3c..f26d6bb5 100644
--- a/sermant-plugins/sermant-springboot-registry/springboot-registry-plugin/src/main/java/com/huawei/discovery/utils/RequestInterceptorUtils.java
+++ b/sermant-plugins/sermant-springboot-registry/springboot-registry-plugin/src/main/java/com/huawei/discovery/utils/RequestInterceptorUtils.java
@@ -16,7 +16,9 @@
 
 package com.huawei.discovery.utils;
 
+import com.huawei.discovery.entity.Recorder;
 import com.huawei.discovery.entity.ServiceInstance;
+import com.huawei.discovery.entity.SimpleRequestRecorder;
 import com.huawei.discovery.retry.InvokerContext;
 
 import com.huaweicloud.sermant.core.common.LoggerFactory;
@@ -44,9 +46,10 @@ import java.util.logging.Logger;
  * @since 2022-10-09
  */
 public class RequestInterceptorUtils {
-
     private static final Logger LOGGER = LoggerFactory.getLogger();
 
+    private static final Recorder RECORDER = new SimpleRequestRecorder();
+
     private RequestInterceptorUtils() {
 
     }
@@ -91,6 +94,7 @@ public class RequestInterceptorUtils {
         String path = String.format(Locale.ENGLISH, "/%s%s", hostAndPath.get(HttpConstants.HTTP_URI_HOST),
                 hostAndPath.get(HttpConstants.HTTP_URI_PATH));
         LOGGER.log(Level.FINE, String.format(Locale.ENGLISH, "[%s] request [%s] has been intercepted!", source, path));
+        RECORDER.beforeRequest();
     }
 
     /**
diff --git a/sermant-plugins/sermant-springboot-registry/springboot-registry-service/src/main/java/com/huawei/discovery/service/lb/stats/InstanceStats.java b/sermant-plugins/sermant-springboot-registry/springboot-registry-service/src/main/java/com/huawei/discovery/service/lb/stats/InstanceStats.java
index fe04669a..78528cb2 100644
--- a/sermant-plugins/sermant-springboot-registry/springboot-registry-service/src/main/java/com/huawei/discovery/service/lb/stats/InstanceStats.java
+++ b/sermant-plugins/sermant-springboot-registry/springboot-registry-service/src/main/java/com/huawei/discovery/service/lb/stats/InstanceStats.java
@@ -53,24 +53,25 @@ public class InstanceStats implements Recorder {
     /**
      * 时间窗口
      */
-    private final long activeRequestTimeoutWindowMs;
+    private final long instanceStateTimeWindowMs;
 
     /**
-     * 上一次记录并发数的时间戳
+     * 上一次时间窗口更新时间, 作为时间窗口的左边界
      */
-    private volatile long lastActiveRequestTimestamp;
+    private volatile long lastLeftWindowTime;
 
     /**
-     * 平均响应时间
+     * 时间窗口内的平均响应时间
      */
-    private double responseAvgTime = 0d;
+    private volatile double responseAvgTime;
 
     /**
      * 构造器
      */
     public InstanceStats() {
-        this.activeRequestTimeoutWindowMs =
-                PluginConfigManager.getPluginConfig(LbConfig.class).getActiveRequestTimeoutWindowMs();
+        this.instanceStateTimeWindowMs =
+                PluginConfigManager.getPluginConfig(LbConfig.class).getInstanceStatTimeWindowMs();
+        lastLeftWindowTime = System.currentTimeMillis();
     }
 
     /**
@@ -80,7 +81,6 @@ public class InstanceStats implements Recorder {
     public void beforeRequest() {
         activeRequests.incrementAndGet();
         allRequestCount.incrementAndGet();
-        lastActiveRequestTimestamp = System.currentTimeMillis();
     }
 
     /**
@@ -102,13 +102,24 @@ public class InstanceStats implements Recorder {
         baseStats(consumeTimeMs);
     }
 
+    private void calculateResponseAvgTime() {
+        final long allConsumeTime = allRequestConsumeTime.get();
+        final long currentTimeMillis = System.currentTimeMillis();
+        if (currentTimeMillis - lastLeftWindowTime >= this.instanceStateTimeWindowMs) {
+            lastLeftWindowTime = currentTimeMillis;
+            allRequestCount.set(0);
+            allRequestConsumeTime.set(0);
+        }
+        this.responseAvgTime = allRequestCount.get() == 0 ? 0 : (allConsumeTime * 1d / allRequestCount.get());
+    }
+
     private void baseStats(long consumeTimeMs) {
         final long request = activeRequests.decrementAndGet();
         if (request < 0) {
             activeRequests.set(0);
         }
-        final long responseTime = allRequestConsumeTime.addAndGet(consumeTimeMs);
-        responseAvgTime = allRequestCount.get() == 0 ? 0 : (responseTime * 1d / allRequestCount.get());
+        allRequestConsumeTime.addAndGet(consumeTimeMs);
+        this.calculateResponseAvgTime();
     }
 
     /**
@@ -134,7 +145,8 @@ public class InstanceStats implements Recorder {
     public long getActiveRequests() {
         final long activeCount = activeRequests.get();
         final long currentTimeMillis = System.currentTimeMillis();
-        if (currentTimeMillis - lastActiveRequestTimestamp >= this.activeRequestTimeoutWindowMs) {
+        if (currentTimeMillis - lastLeftWindowTime >= this.instanceStateTimeWindowMs) {
+            lastLeftWindowTime = currentTimeMillis;
             this.activeRequests.set(0);
             return 0;
         }
@@ -145,6 +157,11 @@ public class InstanceStats implements Recorder {
         return failRequestCount;
     }
 
+    /**
+     * 获取平均响应时间
+     *
+     * @return responseAvgTime
+     */
     public double getResponseAvgTime() {
         return responseAvgTime;
     }
diff --git a/sermant-plugins/sermant-springboot-registry/springboot-registry-service/src/main/java/com/huawei/discovery/service/retry/RetryServiceImpl.java b/sermant-plugins/sermant-springboot-registry/springboot-registry-service/src/main/java/com/huawei/discovery/service/retry/RetryServiceImpl.java
index d2304a44..ce5ee597 100644
--- a/sermant-plugins/sermant-springboot-registry/springboot-registry-service/src/main/java/com/huawei/discovery/service/retry/RetryServiceImpl.java
+++ b/sermant-plugins/sermant-springboot-registry/springboot-registry-service/src/main/java/com/huawei/discovery/service/retry/RetryServiceImpl.java
@@ -40,7 +40,6 @@ import java.net.ConnectException;
 import java.net.NoRouteToHostException;
 import java.time.LocalDateTime;
 import java.util.Arrays;
-import java.util.Collections;
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
@@ -67,7 +66,9 @@ public class RetryServiceImpl implements InvokerService {
             ConnectException.class,
             NoRouteToHostException.class);
 
-    private final List<String> rawRetryEx = Collections.singletonList("org.apache.http.conn.ConnectTimeoutException");
+    private final List<String> rawRetryEx = Arrays.asList(
+            "org.apache.http.conn.ConnectTimeoutException",
+            "org.apache.http.NoHttpResponseException");
 
     private final Map<String, Retry> retryCache = new ConcurrentHashMap<>();
 
@@ -108,9 +109,6 @@ public class RetryServiceImpl implements InvokerService {
         try {
             return invokeWithEx(invokeFunc, serviceName, retry);
         } catch (RetryException ex) {
-            // 走异常处理流程
-            LOGGER.log(Level.WARNING, String.format(Locale.ENGLISH, "Retry failed with %s times",
-                    retry.config().getMaxRetry()), ex);
             return Optional.ofNullable(exFunc.apply(ex.getRealEx()));
         } catch (Exception ex) {
             // 重试最终失败抛出异常, 需对异常进行封装, 返回给上游, 或者作为当前调用返回调用方
diff --git a/sermant-plugins/sermant-springboot-registry/springboot-registry-service/src/test/java/com/huawei/discovery/service/lb/stats/InstanceStatsTest.java b/sermant-plugins/sermant-springboot-registry/springboot-registry-service/src/test/java/com/huawei/discovery/service/lb/stats/InstanceStatsTest.java
index 5b8bb279..3fc46985 100644
--- a/sermant-plugins/sermant-springboot-registry/springboot-registry-service/src/test/java/com/huawei/discovery/service/lb/stats/InstanceStatsTest.java
+++ b/sermant-plugins/sermant-springboot-registry/springboot-registry-service/src/test/java/com/huawei/discovery/service/lb/stats/InstanceStatsTest.java
@@ -68,7 +68,7 @@ public class InstanceStatsTest extends BaseTest {
 
     @Test
     public void testActiveRequest() throws InterruptedException {
-        lbConfig.setActiveRequestTimeoutWindowMs(1L);
+        lbConfig.setInstanceStatTimeWindowMs(1L);
         final InstanceStats stats = new InstanceStats();
         stats.beforeRequest();
         Thread.sleep(10);