Skip to content

Commit

Permalink
Increasing timeout for pulsar client io threads to shutdown (apache#8316
Browse files Browse the repository at this point in the history
)

### 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.
  • Loading branch information
jerrypeng authored Oct 22, 2020
1 parent 1cf29f2 commit ace3087
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ public void releaseConnection(ClientCnx cnx) {
@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);
}
Expand Down

0 comments on commit ace3087

Please sign in to comment.