diff options
| author | Matthew Sackman <matthew@rabbitmq.com> | 2011-01-27 16:39:27 +0000 |
|---|---|---|
| committer | Matthew Sackman <matthew@rabbitmq.com> | 2011-01-27 16:39:27 +0000 |
| commit | 55f0abb50c09492ae60057f825e7e7b3446fed1f (patch) | |
| tree | 6b568960bade46a025f4c01e994a3b4ae5cde3cc | |
| parent | 9b488b9597a087ff3c04dffdb67d872f67e15597 (diff) | |
| download | rabbitmq-server-git-55f0abb50c09492ae60057f825e7e7b3446fed1f.tar.gz | |
Stop the channel crashing if we requeue to a dead queue
| -rw-r--r-- | src/rabbit_channel.erl | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/rabbit_channel.erl b/src/rabbit_channel.erl index 91559ea6c9..cc3cfbf4f4 100644 --- a/src/rabbit_channel.erl +++ b/src/rabbit_channel.erl @@ -736,14 +736,18 @@ handle_method(#'basic.qos'{prefetch_count = PrefetchCount}, handle_method(#'basic.recover_async'{requeue = true}, _, State = #ch{unacked_message_q = UAMQ}) -> + OkFun = fun () -> ok end, ok = fold_per_queue( fun (QPid, MsgIds, ok) -> %% The Qpid python test suite incorrectly assumes %% that messages will be requeued in their original %% order. To keep it happy we reverse the id list %% since we are given them in reverse order. - rabbit_amqqueue:requeue( - QPid, lists:reverse(MsgIds), self()) + rabbit_misc:with_exit_handler( + OkFun, fun () -> + rabbit_amqqueue:requeue( + QPid, lists:reverse(MsgIds), self()) + end) end, ok, UAMQ), %% No answer required - basic.recover is the newer, synchronous %% variant of this method |
