diff options
-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 91559ea6..cc3cfbf4 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 |