diff options
| -rw-r--r-- | src/rabbit_amqqueue.erl | 2 | ||||
| -rw-r--r-- | src/rabbit_amqqueue_process.erl | 2 | ||||
| -rw-r--r-- | src/rabbit_channel.erl | 2 | ||||
| -rw-r--r-- | src/rabbit_misc.erl | 16 |
4 files changed, 11 insertions, 11 deletions
diff --git a/src/rabbit_amqqueue.erl b/src/rabbit_amqqueue.erl index f601efb1aa..ff29a8467e 100644 --- a/src/rabbit_amqqueue.erl +++ b/src/rabbit_amqqueue.erl @@ -678,7 +678,7 @@ safe_delegate_call_ok(F, Pids) -> fun () -> F(Pid) end) end), case lists:filter(fun ({_Pid, {exit, {R, _}, _}}) -> - rabbit_misc:is_abnormal_termination(R); + rabbit_misc:is_abnormal_exit(R); ({_Pid, _}) -> false end, Bads) of diff --git a/src/rabbit_amqqueue_process.erl b/src/rabbit_amqqueue_process.erl index 8933de8746..388af413b0 100644 --- a/src/rabbit_amqqueue_process.erl +++ b/src/rabbit_amqqueue_process.erl @@ -788,7 +788,7 @@ handle_queue_down(QPid, Reason, State = #q{queue_monitors = QMons, unconfirmed = UC}) -> case pmon:is_monitored(QPid, QMons) of false -> noreply(State); - true -> case rabbit_misc:is_abnormal_termination(Reason) of + true -> case rabbit_misc:is_abnormal_exit(Reason) of true -> {Lost, _UC1} = dtree:take_all(QPid, UC), QNameS = rabbit_misc:rs(qname(State)), rabbit_log:warning("DLQ ~p for ~s died with " diff --git a/src/rabbit_channel.erl b/src/rabbit_channel.erl index 22c6a22361..73b461cdcc 100644 --- a/src/rabbit_channel.erl +++ b/src/rabbit_channel.erl @@ -1119,7 +1119,7 @@ monitor_delivering_queue(false, QPid, State = #ch{queue_monitors = QMons, delivering_queues = sets:add_element(QPid, DQ)}. handle_publishing_queue_down(QPid, Reason, State = #ch{unconfirmed = UC}) -> - case rabbit_misc:is_abnormal_termination(Reason) of + case rabbit_misc:is_abnormal_exit(Reason) of true -> {MXs, UC1} = dtree:take_all(QPid, UC), send_nacks(MXs, State#ch{unconfirmed = UC1}); false -> {MXs, UC1} = dtree:take(QPid, UC), diff --git a/src/rabbit_misc.erl b/src/rabbit_misc.erl index 804d587b0a..2a51b58b27 100644 --- a/src/rabbit_misc.erl +++ b/src/rabbit_misc.erl @@ -29,7 +29,7 @@ -export([enable_cover/1, report_cover/1]). -export([start_cover/1]). -export([confirm_to_sender/2]). --export([throw_on_error/2, with_exit_handler/2, is_abnormal_termination/1, +-export([throw_on_error/2, with_exit_handler/2, is_abnormal_exit/1, filter_exit_map/2]). -export([with_user/2, with_user_and_vhost/3]). -export([execute_mnesia_transaction/1]). @@ -62,7 +62,7 @@ -export([gb_sets_difference/2]). %% Horrible macro to use in guards --define(BENIGN_TERMINATION(R), +-define(IS_BENIGN_EXIT(R), R =:= noproc; R =:= noconnection; R =:= nodedown; R =:= normal; R =:= shutdown). @@ -142,7 +142,7 @@ -spec(throw_on_error/2 :: (atom(), thunk(rabbit_types:error(any()) | {ok, A} | A)) -> A). -spec(with_exit_handler/2 :: (thunk(A), thunk(A)) -> A). --spec(is_abnormal_termination/1 :: (any()) -> boolean()). +-spec(is_abnormal_exit/1 :: (any()) -> boolean()). -spec(filter_exit_map/2 :: (fun ((A) -> B), [A]) -> [B]). -spec(with_user/2 :: (rabbit_types:username(), thunk(A)) -> A). -spec(with_user_and_vhost/3 :: @@ -428,13 +428,13 @@ with_exit_handler(Handler, Thunk) -> try Thunk() catch - exit:{R, _} when ?BENIGN_TERMINATION(R) -> Handler(); - exit:{{R, _}, _} when ?BENIGN_TERMINATION(R) -> Handler() + exit:{R, _} when ?IS_BENIGN_EXIT(R) -> Handler(); + exit:{{R, _}, _} when ?IS_BENIGN_EXIT(R) -> Handler() end. -is_abnormal_termination(R) when ?BENIGN_TERMINATION(R) -> false; -is_abnormal_termination({R, _}) when ?BENIGN_TERMINATION(R) -> false; -is_abnormal_termination(_) -> true. +is_abnormal_exit(R) when ?IS_BENIGN_EXIT(R) -> false; +is_abnormal_exit({R, _}) when ?IS_BENIGN_EXIT(R) -> false; +is_abnormal_exit(_) -> true. filter_exit_map(F, L) -> Ref = make_ref(), |
