Orderly shutdown with unicast discovery might cause the shutdown node to still be part of the election process, closes #1740.
This commit is contained in:
parent
b0e0dd81eb
commit
43e45a111c
|
@ -23,6 +23,7 @@ import com.google.common.collect.Lists;
|
||||||
import jsr166y.LinkedTransferQueue;
|
import jsr166y.LinkedTransferQueue;
|
||||||
import org.elasticsearch.ElasticSearchException;
|
import org.elasticsearch.ElasticSearchException;
|
||||||
import org.elasticsearch.ElasticSearchIllegalArgumentException;
|
import org.elasticsearch.ElasticSearchIllegalArgumentException;
|
||||||
|
import org.elasticsearch.ElasticSearchIllegalStateException;
|
||||||
import org.elasticsearch.cluster.ClusterName;
|
import org.elasticsearch.cluster.ClusterName;
|
||||||
import org.elasticsearch.cluster.node.DiscoveryNode;
|
import org.elasticsearch.cluster.node.DiscoveryNode;
|
||||||
import org.elasticsearch.cluster.node.DiscoveryNodes;
|
import org.elasticsearch.cluster.node.DiscoveryNodes;
|
||||||
|
@ -342,6 +343,9 @@ public class UnicastZenPing extends AbstractLifecycleComponent<ZenPing> implemen
|
||||||
}
|
}
|
||||||
|
|
||||||
private UnicastPingResponse handlePingRequest(final UnicastPingRequest request) {
|
private UnicastPingResponse handlePingRequest(final UnicastPingRequest request) {
|
||||||
|
if (lifecycle.stoppedOrClosed()) {
|
||||||
|
throw new ElasticSearchIllegalStateException("received ping request while stopped/closed");
|
||||||
|
}
|
||||||
temporalResponses.add(request.pingResponse);
|
temporalResponses.add(request.pingResponse);
|
||||||
threadPool.schedule(TimeValue.timeValueMillis(request.timeout.millis() * 2), ThreadPool.Names.SAME, new Runnable() {
|
threadPool.schedule(TimeValue.timeValueMillis(request.timeout.millis() * 2), ThreadPool.Names.SAME, new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue