Internal: MulticastChannel should wait on receiver thread to stop during shutdown

This was signaled by our tests which shutdown class and check for thread leakage.

Closes #7835
This commit is contained in:
Boaz Leskes 2014-09-23 14:34:05 +02:00
parent 71adb3ada2
commit b70f0d5eef
1 changed files with 5 additions and 1 deletions

View File

@ -21,7 +21,6 @@ package org.elasticsearch.common.network;
import com.google.common.collect.Maps;
import org.apache.lucene.util.IOUtils;
import org.elasticsearch.common.bytes.BytesArray;
import org.elasticsearch.common.bytes.BytesReference;
import org.elasticsearch.common.logging.ESLogger;
@ -316,6 +315,11 @@ public abstract class MulticastChannel implements Closeable {
IOUtils.closeWhileHandlingException(multicastSocket);
multicastSocket = null;
}
try {
receiverThread.join(10000);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
}
private class Receiver implements Runnable {