Skip to content

Commit

Permalink
Clear channel pool on close
Browse files Browse the repository at this point in the history
  • Loading branch information
slandelle committed Jun 6, 2016
1 parent 27bc852 commit 93feccf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Expand Up @@ -354,12 +354,17 @@ public void preemptChannel(Object partitionKey) throws IOException {
}
}

private void doClose() {
openChannels.close();
channelPool.destroy();
}

public void close() {
if (allowReleaseEventLoopGroup) {
eventLoopGroup.shutdownGracefully(config.getShutdownQuietPeriod(), config.getShutdownTimeout(), TimeUnit.MILLISECONDS)//
.addListener(future -> openChannels.close());
.addListener(future -> doClose());
} else
openChannels.close();
doClose();
}

public void closeChannel(Channel channel) {
Expand Down
Expand Up @@ -305,11 +305,6 @@ public void destroy() {
if (isClosed.getAndSet(true))
return;

for (ConcurrentLinkedDeque<IdleChannel> partition : partitions.values()) {
for (IdleChannel idleChannel : partition)
close(idleChannel.channel);
}

partitions.clear();
if (connectionTtlEnabled) {
channelId2Creation.clear();
Expand Down

0 comments on commit 93feccf

Please sign in to comment.