ksql icon indicating copy to clipboard operation
ksql copied to clipboard

The configuration for number of query errors in the `show queries` does not work anymore

Open spena opened this issue 2 years ago • 3 comments

Describe the bug When a query has errors, a list of errors collected is displayed by the SHOW QUERIES EXTENDED or EXPLAIN <query> commands. This list has a config to limit the number of errors displayed. The config is ksql.query.error.max.queue.size and is default to 10. However, the SHOW QUERIES command is displaying more errors than what it is configured and it keeps growing.

Looking at the code, I found the issue was caused by this fix https://github.com/confluentinc/ksql/pull/8875

The queue used to use an EvictionQueue class which evicts queue elements when a size/capacity has been reached. After the previous fix, the capacity is not used anymore, so the queue becomes unbounded on size. It is still time-bounded because the evict() method is called after adding an element. This evict method removes elements that expired in 1 hour window (configured).

Fix: We should keep the queue bounded to capacity and time (as configured). It is important to keep the queue thread-safe, so maybe the fix should be in the evict() method to remove elements if the queue has reach the configured capacity.

spena avatar Sep 07 '22 17:09 spena

I would like to work on this @spena

gunishmatta avatar Sep 10 '22 11:09 gunishmatta

Go head @gunishmatta, take it. We'll assign a priority soon, but you're welcome to start working on this.

spena avatar Sep 12 '22 18:09 spena

@gunishmatta , assigning this to you. Do you know when you can get to it ? Thanks.

suhas-satish avatar Sep 13 '22 16:09 suhas-satish