diff options
| author | Michael Klishin <mklishin@pivotal.io> | 2019-08-15 08:24:55 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-08-15 08:24:55 +1000 |
| commit | 234b6312f7a342a03217206662e82e5a6a34a76b (patch) | |
| tree | 69922ab541744a964097c79997b3e712869ec388 /src | |
| parent | 84c59b76fd50998635a23c44c9c78872520c512c (diff) | |
| parent | 7fea125217ced6aec7b48d06c6f267cee7b58973 (diff) | |
| download | rabbitmq-server-git-234b6312f7a342a03217206662e82e5a6a34a76b.tar.gz | |
Merge pull request #2081 from rabbitmq/fix-consumers/1-when-queue-is-gone
rabbit_amqqueue: Return empty list in consumers/1 when the queue is gone
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_amqqueue.erl | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/rabbit_amqqueue.erl b/src/rabbit_amqqueue.erl index ad6a183dfc..f740aa7c06 100644 --- a/src/rabbit_amqqueue.erl +++ b/src/rabbit_amqqueue.erl @@ -1074,9 +1074,10 @@ consumers(Q) when ?amqqueue_is_classic(Q) -> delegate:invoke(QPid, {gen_server2, call, [consumers, infinity]}); consumers(Q) when ?amqqueue_is_quorum(Q) -> QPid = amqqueue:get_pid(Q), - {ok, {_, Result}, _} = ra:local_query(QPid, - fun rabbit_fifo:query_consumers/1), - maps:values(Result). + case ra:local_query(QPid, fun rabbit_fifo:query_consumers/1) of + {ok, {_, Result}, _} -> maps:values(Result); + _ -> [] + end. -spec consumer_info_keys() -> rabbit_types:info_keys(). |
