You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/11/25 14:09:56 UTC
[GitHub] [pulsar] tisonkun commented on a diff in pull request #18635: [fix][test] Fix multiple Pulsar client leaks in tests
tisonkun commented on code in PR #18635:
URL: https://github.com/apache/pulsar/pull/18635#discussion_r1032490506
##########
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:
This kind of code read strange to me. What's the original purpose of such a code snippet? We obtain a new client but never use it, must we replace the global `pulsarClient` instead of init a local one?
Also, `replacePulsarClient` calls `shutdown` while we call `close` in those test code.
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org