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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(limiter): adjust type for compatibility #10686

Merged
merged 1 commit into from
May 12, 2023

Conversation

lafirest
Copy link
Member

@lafirest lafirest commented May 12, 2023

Fixes

this type used to be 0 | float, but here https://github.com/emqx/emqx/blob/d1089fa4603fddd7035a8487515fcabe496acdfa/apps/emqx/src/emqx_limiter/src/emqx_limiter_schema.erl#LL144C68-L144C68, we set a default value of 1000 to the capacity, it should have been stored as a string, but in some configuration files it is a number which will not trigger a typerefl_from_string call and directly pass to the hocon validator, obviously, the 1000 either 0 or float, so the type must be changed to number().

Summary

馃 Generated by Copilot at 95a67f3

Changed the type of burst_rate in emqx_limiter_schema.erl to support negative values. This allows the rate limiter to borrow tokens from the future.

PR Checklist

Please convert it to a draft if any of the following conditions are not met. Reviewers may skip over until all the items are checked:

  • Added tests for the changes
  • Changed lines covered in coverage report
  • Change log has been added to changes/{ce,ee}/(feat|perf|fix)-<PR-id>.en.md files
  • For internal contributor: there is a jira ticket to track this change
  • If there should be document changes, a PR to emqx-docs.git is sent, or a jira ticket is created to follow up
  • Schema changes are backward compatible

Checklist for CI (.github/workflows) changes

  • If changed package build workflow, pass this action (manual trigger)
  • Change log has been added to changes/ dir for user-facing artifacts update

@lafirest lafirest marked this pull request as ready for review May 12, 2023 10:46
@lafirest lafirest requested a review from a team as a code owner May 12, 2023 10:46
@zhongwencool zhongwencool merged commit f94d280 into emqx:release-50 May 12, 2023
138 checks passed
@lafirest lafirest deleted the fix/limiter_burst_type branch May 12, 2023 12:00
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.

None yet

2 participants