Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.14] Fix TasksIT#testGetTaskWaitForCompletionWithoutStoringResult (#108094) #110012

Merged
merged 1 commit into from
Jun 20, 2024

Conversation

arteam
Copy link
Contributor

@arteam arteam commented Jun 20, 2024

Backports #108094 to 8.14

It seems that the failure (the missed index) has always existed in the test scenario and it's supposed to be handled by TransportGetTaskAction.java. We catch IndexNotFoundException here and convert it to ResourceNotFoundException. Then we catch ResourceNotFoundException here and return a snapshot of a task as a response.

In the stack trace, getFinishedTaskFromIndex was called from getRunningTaskFromNode, not from waitedForCompletion due to a race between creating a get request and unblocking request which are sent asynchronously. I've changed the waitForCompletionTestCase test method to unblock the task only after the request started waiting for the task completion by registering a removal listener. By doing so, we make sure we test the "wait for completion" branch when task is running.

The part about the missed index seems to irrelevant, since waitedForCompletion is able to suppress the error and return a snapshot of running task which is not possible if getFinishedTaskFromIndex gets called directly from getRunningTaskFromNode.

Resolves #106043

@arteam arteam added >test Issues or PRs that are addressing/adding tests auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) labels Jun 20, 2024
@elasticsearchmachine elasticsearchmachine merged commit cc36b7f into 8.14 Jun 20, 2024
16 checks passed
@elasticsearchmachine elasticsearchmachine deleted the backport-108094-8.14 branch June 20, 2024 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) backport >test Issues or PRs that are addressing/adding tests v8.14.2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants