MarvinCai commented on a change in pull request #10028:
URL: https://github.com/apache/pulsar/pull/10028#discussion_r604547233
##########
File path:
pulsar-client/src/main/java/org/apache/pulsar/client/impl/PulsarClientImpl.java
##########
@@ -669,18 +675,105 @@ public void close() throws PulsarClientException {
@Override
public void shutdown() throws PulsarClientException {
try {
- lookup.close();
- cnxPool.close();
- timer.stop();
- externalExecutorProvider.shutdownNow();
- internalExecutorService.shutdownNow();
- conf.getAuthentication().close();
Review comment:
Discussed with Abhilash, we think it is reasonable to just close
whatever resources the PulsarClientImpl create and own when constructor error
out, e.g. a cnxPool or eventLoopGroup & cnxPool, and user should be responsible
to close whatever resources they passed in the PulsarClientImpl's constructor
when catching the exception. We will update the documentation of the API to
remind user.
With this change, situation should only be better in exception case since
now the PulsarClientImpl constructor is not closing any resources if there's an
exception.
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]