Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: KSQL does not accept queries when running QueryLimit - 1 queries #5461

Merged
merged 1 commit into from
May 29, 2020

Conversation

spena
Copy link
Member

@spena spena commented May 22, 2020

Description

Fixes #5454

Problem
Users were not able to execute the maximum number of queries allowed. It was always limit -1 queries permitted.

Reason
The RequestValidator class is checking if the user exceeded the maximum number of queries after the queries are validated and registered in the sandboxed query registry. This check was comparing the current values in the query registry + the new queries to execute.

For instance, if the limit = 1 and there are no queries running, then the check was comparing 1 (new query added to the registry after validation) + 1 (new query already validated) > 1.

Fix
Check if the current values in the query registry exceeded the limit without adding again the new queries to execute.

Testing done

  • Unit tests
  • Manual tests

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 #")

@spena spena requested a review from a team May 22, 2020 17:09
@spena spena force-pushed the fix_query_limit branch from b87379c to c698e14 Compare May 22, 2020 18:49
Copy link
Contributor

@rodesai rodesai left a comment

Choose a reason for hiding this comment

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

LGTM

@spena spena merged commit d64f1bc into confluentinc:master May 29, 2020
@spena spena deleted the fix_query_limit branch May 29, 2020 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

KSQL does not accept more queries when running QueryLimit - 1 queries
2 participants