-
Notifications
You must be signed in to change notification settings - Fork 25.5k
Avoid holding references to SearchExecutionContext in SourceConfirmedTextQuery #134887
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
Avoid holding references to SearchExecutionContext in SourceConfirmedTextQuery #134887
Conversation
Hi @romseygeek, I've created a changelog YAML for you. |
Pinging @elastic/es-storage-engine (Team:StorageEngine) |
I'm not really sure how to test this one, other than running a bunch of queries against a match_only_text field and then checking a heap dump on the server - suggestions welcome! |
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.
LGTM 👍
Agreed, this is difficult to test. The other way to make this unlikely to happen again is to not pass down the context to getValueFetcherProvider(...)
. But it is used there and that would require a bit more work.
…TextQuery (elastic#134887) Lucene Query objects can hang around for longer than a single search, for example as the key in a Query cache. This means that they should not hold references to anything that is only expected to exist for the duration of a single search request. SourceConfirmedTextQuery holds a lambda to load data during query execution. This commit changes one of the constructor calls to avoid capturing unnecessary references to the SearchExecutionContext, an object which is expected to be short-lived.
…TextQuery (#134887) (#134913) Lucene Query objects can hang around for longer than a single search, for example as the key in a Query cache. This means that they should not hold references to anything that is only expected to exist for the duration of a single search request. SourceConfirmedTextQuery holds a lambda to load data during query execution. This commit changes one of the constructor calls to avoid capturing unnecessary references to the SearchExecutionContext, an object which is expected to be short-lived.
…TextQuery (#134887) (#134914) Lucene Query objects can hang around for longer than a single search, for example as the key in a Query cache. This means that they should not hold references to anything that is only expected to exist for the duration of a single search request. SourceConfirmedTextQuery holds a lambda to load data during query execution. This commit changes one of the constructor calls to avoid capturing unnecessary references to the SearchExecutionContext, an object which is expected to be short-lived.
…TextQuery (elastic#134887) Lucene Query objects can hang around for longer than a single search, for example as the key in a Query cache. This means that they should not hold references to anything that is only expected to exist for the duration of a single search request. SourceConfirmedTextQuery holds a lambda to load data during query execution. This commit changes one of the constructor calls to avoid capturing unnecessary references to the SearchExecutionContext, an object which is expected to be short-lived.
Lucene Query objects can hang around for longer than a single search, for example as
the key in a Query cache. This means that they should not hold references to anything
that is only expected to exist for the duration of a single search request.
SourceConfirmedTextQuery holds a lambda to load data during query execution. This
commit changes one of the constructor calls to avoid capturing unnecessary references
to the SearchExecutionContext, an object which is expected to be short-lived.