Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.cluster.ClusterState;
import org.elasticsearch.cluster.ClusterStateTaskExecutor;
import org.elasticsearch.cluster.ClusterStateTaskListener;
Expand Down Expand Up @@ -39,7 +40,7 @@ public void onNoLongerMaster() {

@Override
public void clusterStateProcessed(ClusterState oldState, ClusterState newState) {
onClusterStateProcessed.run();
assert false : "not called";
}

@Override
Expand Down Expand Up @@ -67,7 +68,17 @@ public ClusterTasksResult<Task> execute(final ClusterState currentState, final L
} else {
logger.debug("node [{}] does not exist in cluster state, ignoring", task);
}
resultBuilder.success(task, new LegacyClusterTaskResultActionListener(task, currentState));
resultBuilder.success(task, new ActionListener<>() {
@Override
public void onResponse(ClusterState clusterState) {
task.onClusterStateProcessed.run();
}

@Override
public void onFailure(Exception e) {
task.onFailure(e);
}
});
}

final ClusterState finalState;
Expand Down