Closed
Description
Today when the query parsing fails on a shard, we create a QueryShardException
that serializes the entire QueryBuilder
in the message. All these exceptions are kept on a per-shard basis by the coordinating node so we except them to be light weight. For very large boolean queries (with lots of clauses that trip the max_clause_count
for instance) this can cause memory pressure on the coordinating node since we don't de-duplicate exceptions coming from different shards.
The simplest fix would be to limit the size of the QueryShardException
's message by truncating the QueryBuilder serialization if it is above a certain threshold (1k ?).