Skip to content

Commit

Permalink
Temp extra commit
Browse files Browse the repository at this point in the history
  • Loading branch information
nielsbauman committed Jan 20, 2025
1 parent 303acb5 commit 3b63793
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.elasticsearch.ElasticsearchTimeoutException;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.action.ActionRunnable;
Expand All @@ -23,6 +22,7 @@
import org.elasticsearch.cluster.service.ClusterService;
import org.elasticsearch.common.util.concurrent.EsExecutors;
import org.elasticsearch.core.TimeValue;
import org.elasticsearch.discovery.MasterNotDiscoveredException;
import org.elasticsearch.node.NodeClosedException;
import org.elasticsearch.tasks.CancellableTask;
import org.elasticsearch.tasks.Task;
Expand Down Expand Up @@ -72,6 +72,8 @@ protected final void doExecute(Task task, Request request, ActionListener<Respon
} else {
waitForClusterUnblock(task, request, listener, state, clusterBlockException);
}
} else if (state.nodes().getMasterNode() == null) {
waitForClusterUnblock(task, request, listener, state, null);
} else {
innerDoExecute(task, request, listener, state);
}
Expand Down Expand Up @@ -117,9 +119,12 @@ public void onTimeout(TimeValue timeout) {
() -> format("timed out while waiting for cluster to unblock in [%s] (timeout [%s])", actionName, timeout),
exception
);
listener.onFailure(new ElasticsearchTimeoutException("timed out while waiting for cluster to unblock", exception));
listener.onFailure(new MasterNotDiscoveredException(exception));
}
}, clusterState -> isTaskCancelled(task) || checkBlock(request, clusterState) == null);
},
clusterState -> isTaskCancelled(task)
|| (clusterState.nodes().getMasterNode() != null && checkBlock(request, clusterState) == null)
);
}

private boolean isTaskCancelled(Task task) {
Expand Down

0 comments on commit 3b63793

Please sign in to comment.