HCOLL-133 Avoid duplicate closing of TCP/UDP replicators

This commit is contained in:
leventov
2014-09-14 15:00:34 +04:00
parent b0229b9afa
commit 69ea009f02
4 changed files with 57 additions and 58 deletions
@@ -58,6 +58,7 @@ abstract class AbstractChannelReplicator implements Closeable {
private final Queue<Runnable> pendingRegistrations = new ConcurrentLinkedQueue<Runnable>();
@Nullable
private final Throttler throttler;
volatile boolean isClosed = false;
AbstractChannelReplicator(String name, ThrottlingConfig throttlingConfig,
int maxEntrySizeBytes)
@@ -108,6 +109,7 @@ abstract class AbstractChannelReplicator implements Closeable {
@Override
public void close() {
isClosed = true;
closeables.closeQuietly();
executorService.shutdownNow();
}