ksql icon indicating copy to clipboard operation
ksql copied to clipboard

Fix/9533 Updated TimeBoundedQueue to be bound by capacity and duration both

Open gunishmatta opened this issue 2 years ago • 1 comments

Description

Original Issue TimeBoundedQueue has been fixed to bounded by both time and capacity

Currently, When a query has errors, a list of errors collected is displayed by the SHOW QUERIES EXTENDED or EXPLAIN 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. This was due to this fix

So to prevent this, I have added a capacity member in the TimeBoundedQueue Class and in evict method, if the elements are less than capacity than only we will skip poll else we will evict out the elements, For more context refer code change.

Testing done

Have added Unit Tests for the same

Reviewer checklist

  • [ ] Ensure docs are updated if necessary. (eg. if a user visible feature is being added or changed).
  • [ ] Ensure relevant issues are linked (description should include text like "Fixes #")

gunishmatta avatar Nov 07 '22 17:11 gunishmatta

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

CLAassistant avatar Nov 07 '22 17:11 CLAassistant