poorbarcode commented on code in PR #16540:
URL: https://github.com/apache/pulsar/pull/16540#discussion_r941986550


##########
pulsar-broker/src/test/java/org/apache/pulsar/broker/service/BrokerServiceTest.java:
##########
@@ -979,7 +980,31 @@ public void testLookupThrottlingForClientByClient() throws 
Exception {
         EventLoopGroup eventLoop = EventLoopUtil.newEventLoopGroup(20, false,
                 new DefaultThreadFactory("test-pool", 
Thread.currentThread().isDaemon()));
         long reqId = 0xdeadbeef;
-        try (ConnectionPool pool = new ConnectionPool(conf, eventLoop)) {
+
+        // using an array in order to reset a new CountDownLatch
+        CountDownLatch[] latch = new CountDownLatch[1];

Review Comment:
   Is there has thread safety issue with multiple threads accessing 
`CountDownLatch[] latch`? Now the code should be fine, I feel like maybe 
`AtomicReference` is better
   
   



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