Skip to content

Commit 377ed0f

Browse files
michaelklishinmergify[bot]
authored andcommitted
Correct channel error when the per-user channel limit is exceeded
The message currently logs a node name. This is likely just a copy-paste artifact from the original channel limit which was per-node, and therefore logged (and still does) the node name. (cherry picked from commit 358739a)
1 parent a3cd06c commit 377ed0f

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

deps/rabbit/src/rabbit_reader.erl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -955,11 +955,11 @@ create_channel(Channel,
955955
put({ch_pid, ChPid}, {Channel, MRef}),
956956
put({channel, Channel}, {ChPid, AState}),
957957
{ok, {ChPid, AState}, State#v1{channel_count = ChannelCount + 1}};
958-
{true, Limit, Fmt} ->
958+
{true, Limit, Fmt, FmtArg} ->
959959
{error, rabbit_misc:amqp_error(
960960
not_allowed,
961961
Fmt,
962-
[node(), Limit], 'none')}
962+
[FmtArg, Limit], 'none')}
963963
end.
964964

965965
is_over_limits(Username) ->
@@ -972,13 +972,13 @@ is_over_limits(Username) ->
972972
Fmt =
973973
"number of channels opened on node '~ts' has reached "
974974
"the maximum allowed limit of (~w)",
975-
{true, Limit, Fmt}
975+
{true, Limit, Fmt, node()}
976976
end;
977977
{true, Limit} ->
978978
Fmt =
979979
"number of channels opened for user '~ts' has reached "
980980
"the maximum allowed user limit of (~w)",
981-
{true, Limit, Fmt}
981+
{true, Limit, Fmt, Username}
982982
end.
983983

984984
is_over_node_channel_limit() ->

0 commit comments

Comments
 (0)