-
Notifications
You must be signed in to change notification settings - Fork 25.4k
Fix async stop sometimes not properly collecting result #121843
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
Conversation
Hi @smalyshev, I've created a changelog YAML for you. |
Hi @smalyshev, I've updated the changelog YAML for you. |
Pinging @elastic/es-analytical-engine (Team:Analytics) |
@smalyshev Line 222 in 2fbec77
This is because the listener does not include storing results to the index: Line 191 in 67ee034
We could avoid this issue if the Line 186 in 2fbec77
I'm a bit hesitant about this proposal in this PR because it would deduplicate the get-result logic more. |
@dnhatn We don't change much logic-wise - we fetch the task ID anyway, the only change is that we'd wait for it to finish on one of the branches. As you note, if we move listener wrap earlier, we'd have to also move execution info creation and it may cause other problems? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One ask, but LGTM. Thanks @smalyshev.
})); | ||
} | ||
|
||
private EsqlQueryTask getEsqlQueryTask(AsyncExecutionId asyncId) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is related to security, can we expose and use AsyncTaskIndexService#getTaskAndCheckAuthentication instead of duplicating it here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I didn't notice this exists. This is even better.
💔 Backport failed
You can use sqren/backport to manually backport by running |
* Fix async stop sometimes not properly collecting result (cherry picked from commit d11dad4) # Conflicts: # x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/plugin/TransportEsqlQueryAction.java
💚 All backports created successfully
Questions ?Please refer to the Backport tool documentation |
* Fix async stop sometimes not properly collecting result (cherry picked from commit d11dad4) # Conflicts: # muted-tests.yml # x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/plugin/TransportEsqlQueryAction.java
* Fix async stop sometimes not properly collecting result (cherry picked from commit d11dad4)
* Fix async stop sometimes not properly collecting result (cherry picked from commit d11dad4)
If the request finishes before the stop is called, but the result is not stored yet, we rely on async functionality to collect the response. I though that we are guaranteed that the data would be stored before the final handler is completed, but looks like it's not always the case. So this explicitly checks the task is finished before trying to collect.
Fixes #121249