- Notifications
You must be signed in to change notification settings - Fork 25.5k
Simplify result handling in FetchSearchPhase #115723
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
Simplify result handling in FetchSearchPhase #115723
Conversation
The results instance does not need to be a field. It's state handling is fairly straight forward, it needs to be released once all fetches have been procesed. No need to even create it on any other path so I split up the method slightly to clearly isolate when and how we need the results instance. Part of elastic#115722
Pinging @elastic/es-search (Team:Search) |
try (fetchResults) { | ||
moveToNextPhase(fetchResults.getAtomicArray(), reducedQueryPhase); | ||
} |
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.
This overall change makes sense to me. I dislike keeping an object around in the constructor and handling lifetimes like we did. Its always confusing.
Just calling out now that with this try (autoClose), we will now release the fetchResults
AFTER context.executeNextPhase
is called. I am not sure that is a big issue or not as generally the search phases do asynchronous actions.
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.
That's to some extend by design :D The aggressive closing of these things has been causing a leak (preexisting bug) to show at a higher rate. Let me deal with that bug in a separate PR today and then I'll reintroduce aggressive closing here again tomorrow or so.
Thanks Ben! |
The results instance does not need to be a field. It's state handling is fairly straight forward, it needs to be released once all fetches have been procesed. No need to even create it on any other path so I split up the method slightly to clearly isolate when and how we need the results instance. Part of elastic#115722
The results instance does not need to be a field. It's state handling is fairly straight forward, it needs to be released once all fetches have been procesed. No need to even create it on any other path so I split up the method slightly to clearly isolate when and how we need the results instance. Part of elastic#115722
The results instance does not need to be a field. It's state handling is fairly straight forward, it needs to be released once all fetches have been procesed. No need to even create it on any other path so I split up the method slightly to clearly isolate when and how we need the results instance. Part of elastic#115722
The results instance does not need to be a field. It's state handling is fairly straight forward, it needs to be released once all fetches have been procesed. No need to even create it on any other path so I split up the method slightly to clearly isolate when and how we need the results instance. Part of #115722
The results instance does not need to be a field.
It's state handling is fairly straight forward, it needs to be released once all fetches have been procesed. No need to even create it on any other path so I split up the method slightly to clearly isolate when and how we need the results instance.
This should give a bit of a speedup since it reduces GC by reducing the lifetime of the results and removing a mutation of the global context resources list.
Part of #115722