summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLajos Gerecs <lajos.gerecs@erlang-solutions.com>2019-09-30 21:13:33 +0200
committerLajos Gerecs <lajos.gerecs@erlang-solutions.com>2019-09-30 21:21:23 +0200
commit071ff4cc377129b031852e44a64b6e74fa8e4d02 (patch)
tree167ae478b00559a9adcf09c533ec3ee24b082467 /src
parentafe99c9f342a32584d973ebbeaf0245fe9d23ab4 (diff)
downloadrabbitmq-server-git-071ff4cc377129b031852e44a64b6e74fa8e4d02.tar.gz
fix health check returning ok in case of partition
Health check assumed if the result of partitions() is a list then everything is ok, this is not the case the result is always a list. rabbit_node_monitor:partitions() returns a non empty list in case there is an mnesia_partition.
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_health_check.erl7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/rabbit_health_check.erl b/src/rabbit_health_check.erl
index 7a127f9bf6..aa739be33f 100644
--- a/src/rabbit_health_check.erl
+++ b/src/rabbit_health_check.erl
@@ -62,8 +62,11 @@ node_health_check(list_queues) ->
node_health_check(rabbit_node_monitor) ->
case rabbit_node_monitor:partitions() of
- L when is_list(L) ->
- ok
+ [] ->
+ ok;
+ L when is_list(L), length(L) > 0 ->
+ ErrorMsg = io_lib:format("cluster partition in effect: ~p", [L]),
+ {error_string, ErrorMsg}
end;
node_health_check(alarms) ->