WaitForTask timeout in case of a task cancellation
irevoire opened this issue · comments
Description
Hello, I was looking for bugs in the SDK and realized that when we call WaitForTask
:
meilisearch-java/src/main/java/com/meilisearch/sdk/TasksHandler.java
Lines 145 to 151 in 969d576
This condition is wrong:
status == null
|| (!status.equals(TaskStatus.SUCCEEDED) && !status.equals(TaskStatus.FAILED))
If the task gets canceled, then the loop hangs forever until it times out.
Instead of checking if the task has succeeded or failed, we should instead use this condition:
status == null
|| (status.equals(TaskStatus.ENQUEUED) || status.equals(TaskStatus.PROCESSING))