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
A new command for Web MQTT connection listing #10693 #9302 #10761
A new command for Web MQTT connection listing #10693 #9302 #10761
Conversation
…part needs more work)
The new command suite in mixed cluster version still fails with
which is a build system-level issue. We will either fix it or remove the mixed cluster version. This command is new and we can expect that it won't be executed before all cluster nodes are upgraded (at least this is not a risky assumption to make). |
list_local_connections_of_protocol(Protocol) -> | ||
case ranch_ref_of_protocol(Protocol) of | ||
undefined -> []; | ||
AcceptorRef -> ranch:procs(AcceptorRef, connections) |
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.
This function calls
supervisor:which_children/1
which documents:
Notice that calling this function when supervising many children under low memory conditions can cause an out of memory exception.
So, this implementation is dangerous when there are many connections, which is typical for MQTT.
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.
Unfortunately, there isn't a more efficient way to do it in Ranch. Introducing connection tracking tables for Web MQTT would completely change the stope of this PR, which is meant to be a bug fix.
{clientid, rabbit_data_coercion:to_binary(ClientId)} | ||
] ++ WsOpts ++ AdditionalOpts, | ||
{ok, C} = emqtt:start_link(Options), | ||
{C, Connect}. |
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.
This file is a copy of a part of deps/rabbitmq_mqtt/test/util.erl
.
Is it possible to reuse that file instead of copying code?
The Web MQTT plugin already depends on the MQTT plugin.
PR #10761 added a new CLI command to list Web MQTT connections. That new CLI command relies on feature flag delete_ra_cluster_mqtt_node being enabled. This commit ensures exactly this condition.
Fixes #10761 (comment) : "Could you please check a real condition that the old version can't be used as part of this test? is_mixed_versions() will still return true in 10 years when testing RabbitMQ 21.x against 22.x. This function should almost never be used."
Fixes #10761 (comment) : "Could you please check a real condition that the old version can't be used as part of this test? is_mixed_versions() will still return true in 10 years when testing RabbitMQ 21.x against 22.x. This function should almost never be used." (cherry picked from commit 3fd96b5)
PR #10761 added a new CLI command to list Web MQTT connections. That new CLI command relies on feature flag delete_ra_cluster_mqtt_node being enabled. This commit ensures exactly this condition.
Fixes #10761 (comment) : "Could you please check a real condition that the old version can't be used as part of this test? is_mixed_versions() will still return true in 10 years when testing RabbitMQ 21.x against 22.x. This function should almost never be used."
This is #10693 by @LoisSotoLopez with the necessary Bazel build system updates.
Closes #9302.