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

albumenj 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 913e66e965 Supplementary dirctory metrics data push (#12539)
913e66e965 is described below

commit 913e66e96586ee1fd30362f76c6d1ac6781bda32
Author: wxbty <[email protected]>
AuthorDate: Mon Jun 19 17:37:37 2023 +0800

    Supplementary dirctory metrics data push (#12539)
    
    * Supplementary dirctory metrics data push
    
    * puplish after publish
---
 .../apache/dubbo/rpc/cluster/directory/AbstractDirectory.java  | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git 
a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/directory/AbstractDirectory.java
 
b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/directory/AbstractDirectory.java
index a1ea668291..c4561dfe4f 100644
--- 
a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/directory/AbstractDirectory.java
+++ 
b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/directory/AbstractDirectory.java
@@ -476,15 +476,21 @@ public abstract class AbstractDirectory<T> implements 
Directory<T> {
     }
 
     private boolean addValidInvoker(Invoker<T> invoker) {
+        boolean result;
         synchronized (this.validInvokers) {
-            return this.validInvokers.add(invoker);
+            result = this.validInvokers.add(invoker);
         }
+        
MetricsEventBus.publish(RegistryEvent.refreshDirectoryEvent(applicationModel, 
getSummary()));
+        return result;
     }
 
     private boolean removeValidInvoker(Invoker<T> invoker) {
+        boolean result;
         synchronized (this.validInvokers) {
-            return this.validInvokers.remove(invoker);
+            result = this.validInvokers.remove(invoker);
         }
+        
MetricsEventBus.publish(RegistryEvent.refreshDirectoryEvent(applicationModel, 
getSummary()));
+        return result;
     }
 
     protected abstract List<Invoker<T>> doList(SingleRouterChain<T> 
singleRouterChain,

Reply via email to