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
feat: change mqtt.max_packet_size type from string to bytesize #11438
Merged
zhongwencool
merged 3 commits into
emqx:master
from
zhongwencool:max-packet-size-validate
Aug 14, 2023
Merged
feat: change mqtt.max_packet_size type from string to bytesize #11438
zhongwencool
merged 3 commits into
emqx:master
from
zhongwencool:max-packet-size-validate
Aug 14, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
zhongwencool
force-pushed
the
max-packet-size-validate
branch
from
August 14, 2023 02:08
b2e687d
to
5822f43
Compare
zhongwencool
force-pushed
the
max-packet-size-validate
branch
from
August 14, 2023 02:10
5822f43
to
e10f9e5
Compare
zhongwencool
requested review from
JimMoen,
lafirest and
a team
as code owners
August 14, 2023 02:15
|
lafirest
previously approved these changes
Aug 14, 2023
HJianBo
previously approved these changes
Aug 14, 2023
id
reviewed
Aug 14, 2023
apps/emqx/src/emqx_schema.erl
Outdated
@@ -2618,6 +2616,16 @@ validate_heap_size(Siz) when is_integer(Siz) -> | |||
validate_heap_size(_SizStr) -> | |||
{error, invalid_heap_size}. | |||
|
|||
validate_packet_size(Siz) when is_integer(Siz) andalso Siz < 1 -> | |||
{error, #{reason => max_heap_size_too_small, minimum => 1}}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggested change
{error, #{reason => max_heap_size_too_small, minimum => 1}}; | |
{error, #{reason => max_packet_size_too_small, minimum => 1}}; |
?
apps/emqx/src/emqx_schema.erl
Outdated
{error, #{reason => max_heap_size_too_small, minimum => 1}}; | ||
validate_packet_size(Siz) when is_integer(Siz) andalso Siz > ?MAX_INT_MQTT_PACKET_SIZE -> | ||
Max = integer_to_list(round(?MAX_INT_MQTT_PACKET_SIZE / 1024 / 1024)) ++ "M", | ||
{error, #{reason => max_heap_size_too_large, maximum => Max}}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggested change
{error, #{reason => max_heap_size_too_large, maximum => Max}}; | |
{error, #{reason => max_packet_size_too_large, maximum => Max}}; |
?
id
approved these changes
Aug 14, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes EMQX-10587
It鈥檚 more friendly to Frontend to design the range validation.
Before:
After:
Summary
馃 Generated by Copilot at b2e687d
This pull request refactors the schema validation of the
max_packet_size
parameter, removes the unusedmqtt_max_packet_size
type and function, and updates the version numbers of theemqx_dashboard
andemqx_opentelemetry
applications. It also fixes the format of the cluster gauge metric in theemqx_otel
module.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:
changes/(ce|ee)/(feat|perf|fix)-<PR-id>.en.md
filesChecklist for CI (.github/workflows) changes
changes/
dir for user-facing artifacts update