abhilashmandaliya commented on a change in pull request #10441:
URL: https://github.com/apache/pulsar/pull/10441#discussion_r623086334



##########
File path: 
pulsar-client/src/main/java/org/apache/pulsar/client/impl/PulsarClientImpl.java
##########
@@ -764,8 +763,18 @@ public void shutdown() throws PulsarClientException {
         }
     }
 
+    private void closeConnectionPool(ConnectionPool cnxPool) throws 
PulsarClientException {
+        if (createdCnxPool && cnxPool != null) {
+            try {
+                cnxPool.close();
+            } catch (Throwable t) {
+                throw PulsarClientException.unwrap(t);
+            }
+        }
+    }
+
     private void shutdownEventLoopGroup(EventLoopGroup eventLoopGroup) throws 
PulsarClientException {
-        if (createdEventLoopGroup && !eventLoopGroup.isShutdown()) {
+        if (createdEventLoopGroup && eventLoopGroup != null && 
!eventLoopGroup.isShutdown()) {

Review comment:
       this was throwing an exception when this method was called from 
constructor if the exception was thrown before assigning parameter passed 
eventLoopGroup to the member variable eventLoopGroup. The same is for the 
cnxPool.




-- 
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:
us...@infra.apache.org


Reply via email to