-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Prevent closing wrong search contexts in compute service #128222
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
|
Pinging @elastic/es-analytical-engine (Team:Analytics) |
| throw e; | ||
| } | ||
| } | ||
| searchContexts.add(context); |
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.
NIT: I believe it is a bit more readable if context is added in the end of the try block as this emphasizes it is only added when operation is completely successful. Otherwise it looks like a null could be added to a collection sometimes.
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.
Sure, I've updated this in 6a89947
|
Very sneaky. I'd have written it inside the loop every time so I super wouldn't see this. |
|
@idegtiarenko @nik9000 Thanks for the discussion and reviews :) |
💔 Backport failed
You can use sqren/backport to manually backport by running |
This should been fixed in elastic#128222 Relates elastic#128222 Closes elastic#126580
The search context variable should be inside the loop, not outside; otherwise, it may close the previous search context when the target shard is unavailable, potentially leaving search contexts without references. This bug was introduced in unreleased versions (9.1 and 8.19). I think we need to refactor DataNodeComputeHandler to allow writing unit tests for these cases easier, but
testSearchWhileRelocatingshould cover this issue.Closes #127188