summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Klishin <michael@clojurewerkz.org>2017-08-10 03:36:30 +0300
committerMichael Klishin <michael@clojurewerkz.org>2017-08-10 03:36:30 +0300
commit9e5599b3b9f7dc3887287bab487b21fa170b7fad (patch)
treee79fbea684d0634f48ed29dcc546af08314b2da8 /src
parentb9a09c712baa07ff85a9c954ffb4e36b95a1fc37 (diff)
parentec5ffe7296fbb883dccb35802d4bbcf8f2473e0d (diff)
downloadrabbitmq-server-git-9e5599b3b9f7dc3887287bab487b21fa170b7fad.tar.gz
Merge branch 'stable'
Conflicts: src/rabbit_amqqueue.erl
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_amqqueue.erl19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/rabbit_amqqueue.erl b/src/rabbit_amqqueue.erl
index 2d85a9f04b..378f3cbb76 100644
--- a/src/rabbit_amqqueue.erl
+++ b/src/rabbit_amqqueue.erl
@@ -37,8 +37,9 @@
-export([notify_down_all/2, notify_down_all/3, activate_limit_all/2, credit/5]).
-export([on_node_up/1, on_node_down/1]).
-export([update/2, store_queue/1, update_decorators/1, policy_changed/2]).
--export([update_mirroring/1, sync_mirrors/1, cancel_sync_mirrors/1, is_mirrored/1]).
+-export([update_mirroring/1, sync_mirrors/1, cancel_sync_mirrors/1]).
-export([emit_unresponsive/6, emit_unresponsive_local/5, is_unresponsive/2]).
+-export([is_mirrored/1, is_dead_exclusive/1]). % Note: exported due to use in qlc expression.
-export([pid_of/1, pid_of/2]).
-export([mark_local_durable_queues_stopped/1]).
@@ -1014,6 +1015,11 @@ cancel_sync_mirrors(QPid) ->
is_mirrored(Q) ->
rabbit_mirror_queue_misc:is_mirrored(Q).
+is_dead_exclusive(#amqqueue{exclusive_owner = none}) ->
+ false;
+is_dead_exclusive(#amqqueue{exclusive_owner = Pid}) when is_pid(Pid) ->
+ not rabbit_mnesia:is_process_alive(Pid).
+
on_node_up(Node) ->
ok = rabbit_misc:execute_mnesia_transaction(
fun () ->
@@ -1058,11 +1064,12 @@ on_node_down(Node) ->
rabbit_misc:execute_mnesia_tx_with_tail(
fun () -> QsDels =
qlc:e(qlc:q([{QName, delete_queue(QName)} ||
- #amqqueue{name = QName, pid = Pid} = Q
- <- mnesia:table(rabbit_queue),
- not rabbit_amqqueue:is_mirrored(Q) andalso
- node(Pid) == Node andalso
- not rabbit_mnesia:is_process_alive(Pid)])),
+ #amqqueue{name = QName, pid = Pid} =
+ Q <- mnesia:table(rabbit_queue),
+ node(Pid) == Node andalso
+ not rabbit_mnesia:is_process_alive(Pid) andalso
+ (not rabbit_amqqueue:is_mirrored(Q) orelse
+ rabbit_amqqueue:is_dead_exclusive(Q))])),
{Qs, Dels} = lists:unzip(QsDels),
T = rabbit_binding:process_deletions(
lists:foldl(fun rabbit_binding:combine_deletions/2,