Skip to content

Commit

Permalink
address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Valiushko committed Mar 15, 2024
1 parent fcc5500 commit 0b57d2c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
5 changes: 0 additions & 5 deletions deps/rabbit/priv/schema/rabbit.schema
Expand Up @@ -889,11 +889,6 @@ end}.

{mapping, "channel_max", "rabbit.channel_max", [{datatype, integer}]}.

%% Set the max allowed number of channels per node.
%% `infinity` means "no limit".
%%
%% {channel_max_per_node, infinity},

{mapping, "channel_max_per_node", "rabbit.channel_max_per_node",
[{datatype, [{atom, infinity}, integer]}]}.

Expand Down
4 changes: 2 additions & 2 deletions deps/rabbit/src/rabbit_channel.erl
Expand Up @@ -105,8 +105,8 @@
consumer_prefetch,
consumer_timeout,
authz_context,
max_consumers, % taken from rabbit.consumer_max_per_channel
%% defines how ofter gc will be executed
max_consumers % taken from rabbit.consumer_max_per_channel
writer_gc_threshold
}).

Expand Down Expand Up @@ -1318,7 +1318,7 @@ handle_method(#'basic.consume'{queue = <<"amq.rabbitmq.reply-to">>,
_, State = #ch{reply_consumer = ReplyConsumer,
cfg = #conf{max_consumers = MaxConsumers},
consumer_mapping = ConsumerMapping}) ->
CurrentConsumers = length(maps:keys(ConsumerMapping)),
CurrentConsumers = maps:size(ConsumerMapping),
case maps:find(CTag0, ConsumerMapping) of
error when CurrentConsumers >= MaxConsumers -> % false when MaxConsumers is 'infinity'
rabbit_misc:protocol_error(
Expand Down

0 comments on commit 0b57d2c

Please sign in to comment.