diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/action/support/master/TransportMasterNodeOperationAction.java b/modules/elasticsearch/src/main/java/org/elasticsearch/action/support/master/TransportMasterNodeOperationAction.java index abec904b21e..da8d2cf3766 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/action/support/master/TransportMasterNodeOperationAction.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/action/support/master/TransportMasterNodeOperationAction.java @@ -24,10 +24,13 @@ import org.elasticsearch.ElasticSearchIllegalStateException; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.ActionResponse; import org.elasticsearch.action.support.BaseAction; +import org.elasticsearch.cluster.ClusterChangedEvent; import org.elasticsearch.cluster.ClusterService; import org.elasticsearch.cluster.ClusterState; +import org.elasticsearch.cluster.TimeoutClusterStateListener; import org.elasticsearch.cluster.node.DiscoveryNodes; import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.transport.*; @@ -70,6 +73,10 @@ public abstract class TransportMasterNodeOperationAction listener) { + innerExecute(request, listener, false); + } + + private void innerExecute(final Request request, final ActionListener listener, final boolean retrying) { final ClusterState clusterState = clusterService.state(); DiscoveryNodes nodes = clusterState.nodes(); if (nodes.localNodeMaster()) { @@ -98,8 +105,43 @@ public abstract class TransportMasterNodeOperationAction