-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Prevent node from booting if credit_flow_default_credit is not valid #13046
Conversation
26f320b
to
b6df874
Compare
b6df874
to
8164875
Compare
deps/rabbit/src/rabbit.erl
Outdated
@@ -300,6 +300,8 @@ | |||
%% 100 ms | |||
-define(BOOT_STATUS_CHECK_INTERVAL, 100). | |||
|
|||
-define(DEFAULT_CREDIT, {400, 200}). |
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.
We already have this default defined in
rabbitmq-server/deps/rabbit/Makefile
Line 84 in 9af2be3
{credit_flow_default_credit, {400, 200}}, |
Defining yet another default in another place (rabbit.erl
) for the case of user misconfiguration is hard to justify. As @michaelklishin suggested in the discussion, instead of emitting a warning, let's make the node boot fail by throw()
ing an error.
80a6bdb
to
2394d42
Compare
Finished and merged in #13055. I will backport it manually to |
(cherry picked from commit 3dd3433)
Awesome. thanks for your help! |
This PR makes booting the node fail if |
@ansd correct, I have considered this and have left the original condition in place. Let's change that to "lesser or equal". |
…itialCredit (cherry picked from commit 208d3d6)
Done. |
#13046 introduced additional checks which prevent setting `{credit_flow_default_credit,{0,0}}`. Setting credits to zero allows disabling the credit flow mechanism (we use it in our benchmarks and mention for example in https://www.rabbitmq.com/blog/2023/03/21/native-mqtt)
#13046 introduced additional checks which prevent setting `{credit_flow_default_credit,{0,0}}`. Setting credits to zero allows disabling the credit flow mechanism (we use it in our benchmarks and mention for example in https://www.rabbitmq.com/blog/2023/03/21/native-mqtt)
#13046 introduced additional checks which prevent setting `{credit_flow_default_credit,{0,0}}`. Setting credits to zero allows disabling the credit flow mechanism (we use it in our benchmarks and mention for example in https://www.rabbitmq.com/blog/2023/03/21/native-mqtt) (cherry picked from commit a4634d3)
#13046 introduced additional checks which prevent setting `{credit_flow_default_credit,{0,0}}`. Setting credits to zero allows disabling the credit flow mechanism (we use it in our benchmarks and mention for example in https://www.rabbitmq.com/blog/2023/03/21/native-mqtt) (cherry picked from commit a4634d3) Co-authored-by: Michal Kuratczyk <[email protected]>
Proposed Changes
As mention in previous discussion thread, this PR add adds validation for
param
credit_flow_default_credit
, and change it to default value for the following two cases:Types of Changes
What types of changes does your code introduce to this project?
Put an
x
in the boxes that applyChecklist
Put an
x
in the boxes that apply.You can also fill these out after creating the PR.
If you're unsure about any of them, don't hesitate to ask on the mailing list.
We're here to help!
This is simply a reminder of what we are going to look for before merging your code.
CONTRIBUTING.md
documentFurther Comments
If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution
you did and what alternatives you considered, etc.