summaryrefslogtreecommitdiff
path: root/src/rabbit_amqqueue.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/rabbit_amqqueue.erl')
-rw-r--r--src/rabbit_amqqueue.erl22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/rabbit_amqqueue.erl b/src/rabbit_amqqueue.erl
index 00ea2541..56d2c35d 100644
--- a/src/rabbit_amqqueue.erl
+++ b/src/rabbit_amqqueue.erl
@@ -213,25 +213,23 @@ ack(QPid, Txn, MsgIds, ChPid) ->
commit_all(QPids, Txn) ->
Timeout = length(QPids) * ?CALL_TIMEOUT,
safe_pmap_ok(
+ fun (QPid) -> exit({queue_disappeared, QPid}) end,
fun (QPid) -> gen_server:call(QPid, {commit, Txn}, Timeout) end,
QPids).
rollback_all(QPids, Txn) ->
safe_pmap_ok(
+ fun (QPid) -> exit({queue_disappeared, QPid}) end,
fun (QPid) -> gen_server:cast(QPid, {rollback, Txn}) end,
QPids).
notify_down_all(QPids, ChPid) ->
Timeout = length(QPids) * ?CALL_TIMEOUT,
safe_pmap_ok(
- fun (QPid) ->
- rabbit_misc:with_exit_handler(
- %% we don't care if the queue process has terminated
- %% in the meantime
- fun () -> ok end,
- fun () -> gen_server:call(QPid, {notify_down, ChPid},
- Timeout) end)
- end,
+ %% we don't care if the queue process has terminated in the
+ %% meantime
+ fun (_) -> ok end,
+ fun (QPid) -> gen_server:call(QPid, {notify_down, ChPid}, Timeout) end,
QPids).
claim_queue(#amqqueue{pid = QPid}, ReaderPid) ->
@@ -286,10 +284,13 @@ pseudo_queue(QueueName, Pid) ->
arguments = [],
pid = Pid}.
-safe_pmap_ok(F, L) ->
+safe_pmap_ok(H, F, L) ->
case [R || R <- rabbit_misc:upmap(
fun (V) ->
- try F(V)
+ try
+ rabbit_misc:with_exit_handler(
+ fun () -> H(V) end,
+ fun () -> F(V) end)
catch Class:Reason -> {Class, Reason}
end
end, L),
@@ -297,4 +298,3 @@ safe_pmap_ok(F, L) ->
[] -> ok;
Errors -> {error, Errors}
end.
-