Skip to content

Commit

Permalink
Orderly shutdown with unicast discovery might cause the shutdown node…
Browse files Browse the repository at this point in the history
… to still be part of the election process, closes #1740.
  • Loading branch information
kimchy committed Feb 27, 2012
1 parent b0e0dd8 commit 43e45a1
Showing 1 changed file with 4 additions and 0 deletions.
Expand Up @@ -23,6 +23,7 @@
import jsr166y.LinkedTransferQueue;
import org.elasticsearch.ElasticSearchException;
import org.elasticsearch.ElasticSearchIllegalArgumentException;
import org.elasticsearch.ElasticSearchIllegalStateException;
import org.elasticsearch.cluster.ClusterName;
import org.elasticsearch.cluster.node.DiscoveryNode;
import org.elasticsearch.cluster.node.DiscoveryNodes;
Expand Down Expand Up @@ -342,6 +343,9 @@ public void handleException(TransportException exp) {
}

private UnicastPingResponse handlePingRequest(final UnicastPingRequest request) {
if (lifecycle.stoppedOrClosed()) {
throw new ElasticSearchIllegalStateException("received ping request while stopped/closed");
}
temporalResponses.add(request.pingResponse);
threadPool.schedule(TimeValue.timeValueMillis(request.timeout.millis() * 2), ThreadPool.Names.SAME, new Runnable() {
@Override
Expand Down

0 comments on commit 43e45a1

Please sign in to comment.