Skip to content

Conversation

iverase
Copy link
Contributor

@iverase iverase commented Oct 7, 2025

We have observed some OOM exceptions on queries containing boolean queries with many nested wildcard BinaryDvConfirmedQueries. What is annoying on these situations is that those queries will likely hit the max boolean clauses and never succeed but because we are eagerly creating the automatons when creating the queries, we are exhausting the heap available.

In order to avoid that, this change proposes to delay the creation of the automatons when we create the Weight of the query, giving a change to the max boolean clause to stop the execution of abusive queries.

@iverase iverase requested a review from javanna October 7, 2025 13:51
@iverase iverase added >bug :Search Relevance/Search Catch all for Search Relevance v9.3.0 labels Oct 7, 2025
@elasticsearchmachine elasticsearchmachine added the Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch label Oct 7, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-search-relevance (Team:Search Relevance)

@elasticsearchmachine
Copy link
Collaborator

Hi @iverase, I've created a changelog YAML for you.

@iverase iverase removed the request for review from javanna October 7, 2025 13:59
Copy link
Member

@benwtrent benwtrent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This helps us in an extreme edge case for sure. I wonder how much we will gain here though.

Do you know why we don't eagerly check BoolQueryBuilder as well before building the inner queries at all? It seems like we should be checking in our builders directly even before we construct the Lucene queries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Search Relevance/Search Catch all for Search Relevance Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch v9.3.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants