szetszwo commented on code in PR #829:
URL: https://github.com/apache/ratis/pull/829#discussion_r1117375437


##########
ratis-common/src/main/java/org/apache/ratis/util/PeerProxyMap.java:
##########
@@ -165,8 +165,10 @@ public PROXY createProxyImpl(RaftPeer peer) throws 
IOException {
 
   @Override
   public void close() {
-    peers.values().parallelStream().forEach(
-        pp -> pp.setNullProxyAndClose().ifPresent(proxy -> closeProxy(proxy, 
pp)));
+    ConcurrentUtils.parallelForEachAsync(peers.values(),
+        pp -> pp.setNullProxyAndClose().ifPresent(proxy -> closeProxy(proxy, 
pp)),
+        r -> new Thread(r).start()
+    );

Review Comment:
   @adoroszlai , thanks for working on this!  We should join the returned 
future in order to preserve the behavior.
   ```java
       ).join();
   ```



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to