diff options
author | Ben Hood <0x6e6562@gmail.com> | 2008-11-03 15:37:23 +0000 |
---|---|---|
committer | Ben Hood <0x6e6562@gmail.com> | 2008-11-03 15:37:23 +0000 |
commit | efda2e06e4f60663c5f2d4f0e3447f39d8be7a80 (patch) | |
tree | 67033b13ed03e6e09d0ca34563e0b29685081221 /src/rabbit_amqqueue.erl | |
parent | 15fe46007c2df9f2bceade06d9b8b5cb2e27bfc1 (diff) | |
parent | bae21727b74c793967d147ea112b8d87528b07c4 (diff) | |
download | rabbitmq-server-efda2e06e4f60663c5f2d4f0e3447f39d8be7a80.tar.gz |
Merged default into 18776bug18776
Diffstat (limited to 'src/rabbit_amqqueue.erl')
-rw-r--r-- | src/rabbit_amqqueue.erl | 22 |
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. - |