Fix/9533 Updated TimeBoundedQueue to be bound by capacity and duration both #9693
+136
−87
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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