Skip to content

Commit

Permalink
Make sure retryableGetMlTask evaluates task response at least once (#494
Browse files Browse the repository at this point in the history
)

Signed-off-by: Daniel Widdis <[email protected]>
  • Loading branch information
dbwiddis authored Feb 5, 2024
1 parent 281a0b2 commit 2e1c827
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 2e1c827

Please sign in to comment.