Exceeding max number of consumers per channel crashes connection #10970
Replies: 2 comments 1 reply
-
Missed that the original PR (#10749) stated:
so my expected behaviour is wrong, it's expected that the connection should terminate. |
Beta Was this translation helpful? Give feedback.
-
Consumers are scoped per channel, not per connection. Returning a sensible error from a channel is easy, doing the same from connection is also possible but we don't have too many examples of where this is done outside of the connection negotiation sequence. It's a guardrail to protect RabbitMQ from applications leaking consumers, so I don't know how much anyone really cares about returning a meaningful error to a leaking application (logging an informative message is a different story, of course). If someone does, they are welcome to look into it and contribute an improvement. See |
Beta Was this translation helpful? Give feedback.
-
Describe the bug
Version: 3.13.1
Erlang: 26.2.1 [jit]
When setting a value for
consumer_max_per_channel
and exceeding this value, the connection throws an error and terminates. Attached is the log snippet with the crash.log_snippet.txt
Reproduction steps
consumer_max_per_channel
to 10 (I usedsbin/rabbitmqctl eval 'application:set_env(rabbit,consumer_max_per_channel, 10).'
)bunny
).Expected behavior
I would expect that the channel to block new consumers, but that the connection and the channel remains open.
Additional context
Relevant commit: 49e119d
looks like the MaxConsumers is assigned
"\n"
? If I replace MaxConsumers with an arbitrary atom in https://github.com/rabbitmq/rabbitmq-server/blob/main/deps/rabbit/src/rabbit_channel.erl#L1326 then it's not crashing (but connection still closing which might be expected?).Beta Was this translation helpful? Give feedback.
All reactions