abhilashmandaliya commented on a change in pull request #10028:
URL: https://github.com/apache/pulsar/pull/10028#discussion_r600185485
##########
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();
+ // We will throw the last thrown exception only, though logging
all of them.
+ Throwable throwable = null;
+ if (lookup != null) {
+ try {
+ lookup.close();
+ } catch (Throwable t) {
+ log.warn("Failed to shutdown lookup", t);
+ throwable = t;
+ }
+ }
+ try {
+ // Shutting down eventLoopGroup separately because in some
cases, cnxPool might be using different
+ // eventLoopGroup.
+ shutdownEventLoopGroup(eventLoopGroup);
Review comment:
shouldn't cause any issue as I am checking for already shutdown case. If
so, I will not attempt to shut it down. Though I can move it below if you
suggest.
--
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]