[ML] Only push live update if job is opened
Original commit: elastic/x-pack-elasticsearch@5318d650126d8a79165703d5bf2082b82ac49e28
@@ -248,8 +248,13 @@ public class JobManager extends AbstractComponent {
@Override
public void clusterStateProcessed(String source, ClusterState oldState, ClusterState newState) {
+ PersistentTasksCustomMetaData persistentTasks =
+ newState.metaData().custom(PersistentTasksCustomMetaData.TYPE);
+ JobState jobState = MlMetadata.getJobState(jobId, persistentTasks);
+ if (jobState == JobState.OPENED) {
updateJobProcessNotifier.submitJobUpdate(jobUpdate);
}
+ }
});
}
