You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by al...@apache.org on 2021/08/05 06:06:06 UTC

[dubbo] branch 3.0 updated: move count down to final part to avoid meaningless waiting when exception throw (#8406)

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

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


The following commit(s) were added to refs/heads/3.0 by this push:
     new 78d9012  move count down to final part to avoid meaningless waiting when exception throw (#8406)
78d9012 is described below

commit 78d9012c646f032584876bb568b713ebf4391798
Author: tonymarz <87...@users.noreply.github.com>
AuthorDate: Thu Aug 5 14:05:58 2021 +0800

    move count down to final part to avoid meaningless waiting when exception throw (#8406)
    
    * currency call,lost reset
    
    * move count down to final part to avoid meaningless waiting
    
    Co-authored-by: fred.h <fr...@binance.com>
---
 .../dubbo/registry/client/migration/MigrationRuleListener.java     | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/migration/MigrationRuleListener.java b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/migration/MigrationRuleListener.java
index 4c2d75d..a2e0b8c 100644
--- a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/migration/MigrationRuleListener.java
+++ b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/migration/MigrationRuleListener.java
@@ -154,8 +154,11 @@ public class MigrationRuleListener implements RegistryProtocolListener, Configur
 
                             handlers.forEach((_key, handler) ->
                                 executorService.submit(() -> {
-                                    handler.doMigrate(this.rule);
-                                    countDownLatch.countDown();
+                                    try {
+                                        handler.doMigrate(this.rule);
+                                    }finally {
+                                        countDownLatch.countDown();
+                                    }
                                 }));
 
                             try {