summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Sébastien Pédron <jean-sebastien@rabbitmq.com>2022-06-10 13:17:29 +0200
committerJean-Sébastien Pédron <jean-sebastien@rabbitmq.com>2022-06-10 13:17:29 +0200
commit7b51242eb7a23f4f23f709fd23720796216a4565 (patch)
treeb5899424b8d4c47d176817ade31aff3845b998ec
parentaa8b0dc778f30553a13e7d43680e9ab42e309b82 (diff)
downloadrabbitmq-server-git-7b51242eb7a23f4f23f709fd23720796216a4565.tar.gz
rabbit_classic_queue: Use `rabbit_feature_flags`, not `rabbit_ff_registry`
`rabbit_ff_registry` is an internal module of the feature flags subsystem, it is not meant to be called outside of it. In particular, it may lead to crashes very difficult to debug when a feature flag is enabled. The reason is that this module is compiled and reloaded at runtime, so the module may disappear for a small period of time. Another reason is that a process calling `rabbit_ff_registry` may hold that module, preventing the feature flags subsystem from performing its task. The correct public API to query the state of a feature flag is `rabbit_feature_flags:is_enabled/1`. It will always return a boolean. If the feature flag being queried is in `state_changing` state, this function takes care of waiting for the outcome. See #5018.
-rw-r--r--deps/rabbit/src/rabbit_classic_queue.erl4
1 files changed, 2 insertions, 2 deletions
diff --git a/deps/rabbit/src/rabbit_classic_queue.erl b/deps/rabbit/src/rabbit_classic_queue.erl
index 5fffd924d4..dc0c53275a 100644
--- a/deps/rabbit/src/rabbit_classic_queue.erl
+++ b/deps/rabbit/src/rabbit_classic_queue.erl
@@ -514,7 +514,7 @@ update_msg_status(down, Pid, #msg_status{pending = P} = S) ->
confirm_to_sender(Pid, QName, MsgSeqNos) ->
%% the stream queue included the queue type refactoring and thus requires
%% a different message format
- Evt = case rabbit_ff_registry:is_enabled(stream_queue) of
+ Evt = case rabbit_feature_flags:is_enabled(stream_queue) of
true ->
{queue_event, QName, {confirm, MsgSeqNos, self()}};
false ->
@@ -523,7 +523,7 @@ confirm_to_sender(Pid, QName, MsgSeqNos) ->
gen_server2:cast(Pid, Evt).
send_rejection(Pid, QName, MsgSeqNo) ->
- case rabbit_ff_registry:is_enabled(stream_queue) of
+ case rabbit_feature_flags:is_enabled(stream_queue) of
true ->
gen_server2:cast(Pid, {queue_event, QName,
{reject_publish, MsgSeqNo, self()}});