Don't call ClusterService.state() in a ClusterStateUpdateTask
The current state is readily available as a parameter Original commit: elastic/x-pack-elasticsearch@a09929aa82
This commit is contained in:
parent
e3834da05e
commit
308d5e0ae3
|
@ -57,7 +57,7 @@ public class PersistentTasksClusterService extends AbstractComponent implements
|
|||
if (builder.hasTask(taskId)) {
|
||||
throw new ResourceAlreadyExistsException("task with id {" + taskId + "} already exist");
|
||||
}
|
||||
validate(action, clusterService.state(), params);
|
||||
validate(action, currentState, params);
|
||||
final Assignment assignment;
|
||||
assignment = getAssignement(action, currentState, params);
|
||||
return update(currentState, builder.addTask(taskId, action, params, assignment));
|
||||
|
|
Loading…
Reference in New Issue