You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by si...@apache.org on 2020/10/22 16:12:59 UTC

[pulsar] branch master updated: Increasing timeout for pulsar client io threads to shutdown (#8316)

This is an automated email from the ASF dual-hosted git repository.

sijie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/master by this push:
     new ace3087  Increasing timeout for pulsar client io threads to shutdown (#8316)
ace3087 is described below

commit ace3087657d48fe1b44f41a99a016367aa26370a
Author: Boyang Jerry Peng <je...@gmail.com>
AuthorDate: Thu Oct 22 09:12:43 2020 -0700

    Increasing timeout for pulsar client io threads to shutdown (#8316)
    
    ### Motivation
    
    We need to make a best effort to shutdown all threads when close() is on a pulsar client.  If threads spawned by a client are not shutdown when close() returns, this may lead to classloading exceptions/issues if pulsar JARs are unloaded afterwards like the case in a Flink job.
    
    ### Modifications
    
     Increase the wait time for IO threads in the pulsar client to shutdown.
---
 .../src/main/java/org/apache/pulsar/client/impl/ConnectionPool.java     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConnectionPool.java b/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConnectionPool.java
index e1ebecd..869c642 100644
--- a/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConnectionPool.java
+++ b/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConnectionPool.java
@@ -320,7 +320,7 @@ public class ConnectionPool implements Closeable {
     @Override
     public void close() throws IOException {
         try {
-            eventLoopGroup.shutdownGracefully(0, 1, TimeUnit.SECONDS).await();
+            eventLoopGroup.shutdownGracefully(0, 10, TimeUnit.SECONDS).await();
         } catch (InterruptedException e) {
             log.warn("EventLoopGroup shutdown was interrupted", e);
         }