diff options
| author | dcorbacho <dparracorbacho@piotal.io> | 2019-10-28 11:25:47 +0000 |
|---|---|---|
| committer | dcorbacho <dparracorbacho@piotal.io> | 2019-10-28 11:31:33 +0000 |
| commit | 7d455d2784413020d32bfa2ae40e596de2236f99 (patch) | |
| tree | 516ff1192d2d92817176d63539c210d25225e668 | |
| parent | 87f1b31bc869a272a4befaae539916af42ec5db5 (diff) | |
| download | rabbitmq-server-git-7d455d2784413020d32bfa2ae40e596de2236f99.tar.gz | |
Handle timeouts in info calls so we still report all other stats
| -rw-r--r-- | src/rabbit_quorum_queue.erl | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/src/rabbit_quorum_queue.erl b/src/rabbit_quorum_queue.erl index 33bae0919f..d46983b4fc 100644 --- a/src/rabbit_quorum_queue.erl +++ b/src/rabbit_quorum_queue.erl @@ -1052,22 +1052,27 @@ i(open_files, Q) when ?is_amqqueue(Q) -> lists:flatten(Data); i(single_active_consumer_pid, Q) when ?is_amqqueue(Q) -> QPid = amqqueue:get_pid(Q), - {ok, {_, SacResult}, _} = ra:local_query(QPid, - fun rabbit_fifo:query_single_active_consumer/1), - case SacResult of - {value, {_ConsumerTag, ChPid}} -> + case ra:local_query(QPid, fun rabbit_fifo:query_single_active_consumer/1) of + {ok, {_, {value, {_ConsumerTag, ChPid}}}, _} -> ChPid; - _ -> + {ok, _, _} -> + ''; + {error, _} -> + ''; + {timeout, _} -> '' end; i(single_active_consumer_ctag, Q) when ?is_amqqueue(Q) -> QPid = amqqueue:get_pid(Q), - {ok, {_, SacResult}, _} = ra:local_query(QPid, - fun rabbit_fifo:query_single_active_consumer/1), - case SacResult of - {value, {ConsumerTag, _ChPid}} -> + case ra:local_query(QPid, + fun rabbit_fifo:query_single_active_consumer/1) of + {ok, {_, {value, {ConsumerTag, _ChPid}}}, _} -> ConsumerTag; - _ -> + {ok, _, _} -> + ''; + {error, _} -> + ''; + {timeout, _} -> '' end; i(type, _) -> quorum; |
