mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-17 10:25:15 +00:00
[ML] Correctly fetch persistent tasks in JobUpdateAction
Original commit: elastic/x-pack-elasticsearch@440bfdd06e
This commit is contained in:
parent
614aeeeb53
commit
b233c4729d
@ -168,7 +168,7 @@ public class UpdateJobAction extends Action<UpdateJobAction.Request, PutJobActio
|
||||
throw new IllegalArgumentException("Job Id " + Job.ALL + " cannot be for update");
|
||||
}
|
||||
|
||||
PersistentTasksInProgress tasks = clusterService.state().custom(PersistentTasksInProgress.TYPE);
|
||||
PersistentTasksInProgress tasks = clusterService.state().getMetaData().custom(PersistentTasksInProgress.TYPE);
|
||||
boolean jobIsOpen = MlMetadata.getJobState(request.getJobId(), tasks) == JobState.OPENED;
|
||||
|
||||
semaphoreByJob.computeIfAbsent(request.getJobId(), id -> new Semaphore(1)).acquire();
|
||||
@ -181,8 +181,7 @@ public class UpdateJobAction extends Action<UpdateJobAction.Request, PutJobActio
|
||||
releaseJobSemaphore(request.getJobId());
|
||||
listener.onFailure(e);
|
||||
});
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
wrappedListener = ActionListener.wrap(
|
||||
response -> {
|
||||
releaseJobSemaphore(request.getJobId());
|
||||
|
Loading…
x
Reference in New Issue
Block a user