Skip to content

Commit

Permalink
[Backport 2.x] Make sure retryableGetMlTask evaluates task response a…
Browse files Browse the repository at this point in the history
…t least once (#495)

Make sure retryableGetMlTask evaluates task response at least once (#494)


(cherry picked from commit 2e1c827)

Signed-off-by: Daniel Widdis <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
1 parent e987d05 commit d28227c
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ protected void retryableGetMlTask(
ActionListener<MLTask> mlTaskListener
) {
CompletableFuture.runAsync(() -> {
while (!future.isDone()) {
do {
mlClient.getTask(taskId, ActionListener.wrap(response -> {
switch (response.getState()) {
case COMPLETED:
Expand Down Expand Up @@ -128,7 +128,7 @@ protected void retryableGetMlTask(
FutureUtils.cancel(future);
Thread.currentThread().interrupt();
}
}
} while (!future.isDone());
}, threadPool.executor(WORKFLOW_THREAD_POOL));
}

Expand Down

0 comments on commit d28227c

Please sign in to comment.