You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2021/06/22 11:53:23 UTC

[GitHub] [iotdb] wangchao316 commented on a change in pull request #3430: [IOTDB-1447] ClientPool is blocking other nodes when one node fails

wangchao316 commented on a change in pull request #3430:
URL: https://github.com/apache/iotdb/pull/3430#discussion_r656144825



##########
File path: cluster/src/main/java/org/apache/iotdb/cluster/client/async/AsyncClientPool.java
##########
@@ -195,17 +195,17 @@ void onComplete(Node node) {
 
   void recreateClient(Node node) {
     ClusterNode clusterNode = new ClusterNode(node);
-    synchronized (this) {
-      Deque<AsyncClient> clientStack =
-          clientCaches.computeIfAbsent(clusterNode, n -> new ArrayDeque<>());
+    Deque<AsyncClient> clientStack =
+        clientCaches.computeIfAbsent(clusterNode, n -> new ArrayDeque<>());
+    synchronized (clientStack) {
       try {
         AsyncClient asyncClient = asyncClientFactory.getAsyncClient(node, this);
         clientStack.push(asyncClient);
       } catch (IOException e) {
         logger.error("Cannot create a new client for {}", node, e);
         nodeClientNumMap.computeIfPresent(clusterNode, (n, cnt) -> cnt - 1);
       }
-      this.notifyAll();
+      clientStack.notifyAll();

Review comment:
       hi ,this is good job.   
   this is a minor issue .  "this.notifyAll()" is  related "this.wait()".   
   please see 126 line.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org