Skip to content

Commit

Permalink
Merge pull request #2925 from rabbitmq/mk-drain-revive-with-disabled-…
Browse files Browse the repository at this point in the history
…feature-flag

Revisit what drain and revive do when their feature flag is not enabled

(cherry picked from commit 411d494)
  • Loading branch information
michaelklishin committed Mar 24, 2021
1 parent 515aff6 commit d15af54
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions deps/rabbit/src/rabbit_maintenance.erl
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ is_enabled() ->
drain() ->
case is_enabled() of
true -> do_drain();
false -> rabbit_log:warning("Feature flag `~s` is not enabled, draining is a no-op", [?FEATURE_FLAG])
false ->
rabbit_log:error("Feature flag '~s' is not enabled, cannot put this node under maintenance", [?FEATURE_FLAG]),
{error, rabbit_misc:format("Feature flag '~s' is not enabled, cannot put this node under maintenance", [?FEATURE_FLAG])}
end.

-spec do_drain() -> ok.
Expand Down Expand Up @@ -102,7 +104,9 @@ do_drain() ->
revive() ->
case is_enabled() of
true -> do_revive();
false -> rabbit_log:warning("Feature flag `~s` is not enabled, reviving is a no-op", [?FEATURE_FLAG])
false ->
rabbit_log:error("Feature flag '~s' is not enabled, cannot put this node out of maintenance", [?FEATURE_FLAG]),
{error, rabbit_misc:format("Feature flag '~s' is not enabled, cannot put this node out of maintenance", [?FEATURE_FLAG])}
end.

-spec do_revive() -> ok.
Expand Down

0 comments on commit d15af54

Please sign in to comment.