diff options
author | Jean-Sébastien Pédron <jean-sebastien@rabbitmq.com> | 2020-04-07 11:48:26 +0200 |
---|---|---|
committer | Jean-Sébastien Pédron <jean-sebastien@rabbitmq.com> | 2020-04-09 10:21:14 +0200 |
commit | dd45ad5375906e58a673f78264135354c343b0dc (patch) | |
tree | 70ca275f9693b9284774e83a63ecd34f512ad281 | |
parent | 5ca59e46e3e62793b017742caf720022c6cd6192 (diff) | |
download | rabbitmq-server-git-dd45ad5375906e58a673f78264135354c343b0dc.tar.gz |
rabbit_feature_flags: Don't re-initiliaze registry if no feature flags
... from unknown applications were discovered.
In particular, this was triggerring more queries to remote nodes: more
time spent to regen the same registry and potential for errors.
-rw-r--r-- | src/rabbit_feature_flags.erl | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/rabbit_feature_flags.erl b/src/rabbit_feature_flags.erl index de9dae2c9f..6d183cfe42 100644 --- a/src/rabbit_feature_flags.erl +++ b/src/rabbit_feature_flags.erl @@ -1921,11 +1921,16 @@ merge_feature_flags_from_unknown_apps(FeatureFlags) end, #{}, FeatureFlags), - rabbit_log_feature_flags:debug( - "Feature flags: register feature flags provided by applications " - "unknown locally: ~p", - [maps:keys(FeatureFlagsFromUnknownApps)]), - initialize_registry(FeatureFlagsFromUnknownApps). + case maps:keys(FeatureFlagsFromUnknownApps) of + [] -> + ok; + _ -> + rabbit_log_feature_flags:debug( + "Feature flags: register feature flags provided by applications " + "unknown locally: ~p", + [maps:keys(FeatureFlagsFromUnknownApps)]), + initialize_registry(FeatureFlagsFromUnknownApps) + end. exchange_feature_flags_from_unknown_apps(Node, Timeout) -> %% The first step is to fetch feature flags from Erlang applications |