Technoboy- commented on code in PR #16984:
URL: https://github.com/apache/pulsar/pull/16984#discussion_r940045373


##########
pulsar-broker/src/test/java/org/apache/pulsar/broker/service/BrokerServiceTest.java:
##########
@@ -1073,7 +1086,28 @@ public void testLookupThrottlingForClientByClient() 
throws Exception {
                     throw e;
                 }
             }
+        }
+    }
 
+    private static class BlockLookupResponseClientCnx extends ClientCnx{
+
+        private AtomicBoolean blocking;
+
+        public BlockLookupResponseClientCnx(ClientConfigurationData conf, 
EventLoopGroup eventLoopGroup, AtomicBoolean blocking) {
+            super(conf, eventLoopGroup);
+            this.blocking = blocking;
+        }
+
+        protected void handleLookupResponse(CommandLookupTopicResponse 
lookupResult) {
+            while (blocking.get()){
+                try {
+                    Thread.sleep(1);
+                } catch (InterruptedException e) {

Review Comment:
   Semaphore is better than sleep in this case.



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