Skip to content

Commit

Permalink
Schedule recheck if unassignable tasks exist after cluster state change
Browse files Browse the repository at this point in the history
  • Loading branch information
droberts195 committed Dec 11, 2018
1 parent 824ffab commit 610f25e
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,11 @@ public void clusterChanged(ClusterChangedEvent event) {
periodicRechecker.cancel();
logger.trace("checking task reassignment for cluster state {}", event.state().getVersion());
reassignPersistentTasks();
} else if (periodicRechecker.isScheduled() == false &&
isAnyTaskUnassigned(event.state().getMetaData().custom(PersistentTasksCustomMetaData.TYPE))) {
// If a task is unassigned but would still be unassigned following this cluster state event then schedule a
// recheck just in case it would be assignable after a change in some condition external to the cluster state
periodicRechecker.rescheduleIfNecessary();
}
}
}
Expand Down

0 comments on commit 610f25e

Please sign in to comment.