Skip to content

Commit

Permalink
Log incorrectly claims the limit is per node, but the component count…
Browse files Browse the repository at this point in the history
… is over all vhost in the cluster
  • Loading branch information
SimonUnge committed Jan 24, 2025
1 parent a9e972f commit 3702b00
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions deps/rabbit/src/rabbit_runtime_parameters.erl
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,10 @@ is_within_limit(Component) ->
case Limit < 0 orelse count_component(Component) < Limit of
true -> ok;
false ->
ErrorMsg = "Limit reached: component ~ts is limited to ~tp per node",
ErrorMsg = "Limit reached: component ~ts is limited to ~tp",
ErrorArgs = [Component, Limit],
rabbit_log:error(ErrorMsg, ErrorArgs),
{errors, [{"component ~ts is limited to ~tp per node", [Component, Limit]}]}
{errors, [{"component ~ts is limited to ~tp", [Component, Limit]}]}
end.

count_component(Component) -> length(list_component(Component)).
Expand Down
2 changes: 1 addition & 1 deletion deps/rabbit/test/runtime_parameters_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ test_limits(Config) ->
test_limits1(_Config) ->
dummy_runtime_parameters:register(),
application:set_env(rabbit, runtime_parameters, [{limits, [{<<"test">>, 1}]}]),
E = {error_string, "Validation failed\n\ncomponent test is limited to 1 per node\n"},
E = {error_string, "Validation failed\n\ncomponent test is limited to 1\n"},
ok = rabbit_runtime_parameters:set_any(<<"/">>, <<"test">>, <<"good">>, <<"">>, none),
E = rabbit_runtime_parameters:set_any(<<"/">>, <<"test">>, <<"good">>, <<"">>, none),
dummy_runtime_parameters:unregister().

0 comments on commit 3702b00

Please sign in to comment.