This is an automated email from the ASF dual-hosted git repository.

liujun pushed a commit to branch 3.2
in repository https://gitbox.apache.org/repos/asf/dubbo.git


The following commit(s) were added to refs/heads/3.2 by this push:
     new 680481ccdf Change retry times to forever (#12593)
680481ccdf is described below

commit 680481ccdfbeff973a5cc66a42e9ccba87f8ca64
Author: Albumen Kevin <[email protected]>
AuthorDate: Mon Jun 26 12:59:18 2023 +0800

    Change retry times to forever (#12593)
---
 .../src/main/java/org/apache/dubbo/registry/Constants.java            | 4 ++--
 .../main/java/org/apache/dubbo/registry/retry/AbstractRetryTask.java  | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git 
a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/Constants.java
 
b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/Constants.java
index d21534436c..18eba314c8 100644
--- 
a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/Constants.java
+++ 
b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/Constants.java
@@ -66,9 +66,9 @@ public interface Constants {
     int DEFAULT_SESSION_TIMEOUT = 60 * 1000;
 
     /**
-     * Default value for the times of retry: 3
+     * Default value for the times of retry: -1 (forever)
      */
-    int DEFAULT_REGISTRY_RETRY_TIMES = 3;
+    int DEFAULT_REGISTRY_RETRY_TIMES = -1;
 
     int DEFAULT_REGISTRY_RECONNECT_PERIOD = 3 * 1000;
 
diff --git 
a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/retry/AbstractRetryTask.java
 
b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/retry/AbstractRetryTask.java
index 425430b134..c6226db132 100644
--- 
a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/retry/AbstractRetryTask.java
+++ 
b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/retry/AbstractRetryTask.java
@@ -113,7 +113,7 @@ public abstract class AbstractRetryTask implements 
TimerTask {
             // other thread cancel this timeout or stop the timer.
             return;
         }
-        if (times > retryTimes) {
+        if (retryTimes > 0 && times > retryTimes) {
             // 1-13 - failed to execute the retrying task.
 
             logger.warn(

Reply via email to