diff options
| author | Lajos Gerecs <lajos.gerecs@erlang-solutions.com> | 2019-09-30 21:13:33 +0200 |
|---|---|---|
| committer | Lajos Gerecs <lajos.gerecs@erlang-solutions.com> | 2019-09-30 21:21:23 +0200 |
| commit | 071ff4cc377129b031852e44a64b6e74fa8e4d02 (patch) | |
| tree | 167ae478b00559a9adcf09c533ec3ee24b082467 /src | |
| parent | afe99c9f342a32584d973ebbeaf0245fe9d23ab4 (diff) | |
| download | rabbitmq-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.erl | 7 |
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) -> |
