eolivelli commented on a change in pull request #10470:
URL: https://github.com/apache/pulsar/pull/10470#discussion_r624924112



##########
File path: 
pulsar-client/src/main/java/org/apache/pulsar/client/impl/PulsarClientImpl.java
##########
@@ -718,13 +719,11 @@ public void shutdown() throws PulsarClientException {
                 log.warn("Failed to shutdown eventLoopGroup", t);
                 throwable = t;
             }
-            if (createdCnxPool) {
-                try {
-                    cnxPool.close();
-                } catch (Throwable t) {
-                    log.warn("Failed to shutdown cnxPool", t);
-                    throwable = t;
-                }
+            try {
+                closeCnxPool(cnxPool);
+            } catch (Throwable t) {

Review comment:
       I won't change other points, the effect may be unpredictable.
   
   in your new function `closeCnxPool` you are already catching Throwable so 
here it is useless.
   
   catching `Throwable` and `Exception` is always a code smell and we should do 
it only in very specific cases when we know what we are doing.




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


Reply via email to