lhotari commented on code in PR #18635:
URL: https://github.com/apache/pulsar/pull/18635#discussion_r1032560145


##########
pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/v3/AdminApiTransactionTest.java:
##########
@@ -624,8 +624,9 @@ public void testUpdateTransactionCoordinatorNumber() throws 
Exception {
         }
 
         admin.transactions().scaleTransactionCoordinators(coordinatorSize * 2);
-        pulsarClient = 
PulsarClient.builder().serviceUrl(lookupUrl.toString()).enableTransaction(true).build();
+        
replacePulsarClient(PulsarClient.builder().serviceUrl(lookupUrl.toString()).enableTransaction(true));
         pulsarClient.close();

Review Comment:
   When `.enableTransaction(true)` is provided, the client will start the 
transaction coordinator client. Perhaps  @congbobo184 or  @gaoran10 could 
explain the use in test code when the client is immediately closed?
   
   > Also, replacePulsarClient calls shutdown while we call close in those test 
code.
   
   that's true. "shutdown" immediately releases all resource of the client 
without gracefully shutting down consumers, producers etc.. In test code this 
rarely matters. It's a quicker way to terminate the client when the main intent 
is to make sure that resources are released (such as TCP/IP connections are 
closed and thread pools are stopped).
   
   
   
   



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