Skip to content

Commit 0be4ac3

Browse files
committed
Simplify to basically removing the pattern match that crashes
1 parent 2f88068 commit 0be4ac3

File tree

1 file changed

+8
-15
lines changed

1 file changed

+8
-15
lines changed

src/rabbit_amqqueue.erl

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -583,27 +583,20 @@ retry_wait(Q = #amqqueue{pid = QPid, name = Name, state = QState}, F, E, Retries
583583
%% there are no slaves to migrate to
584584
{stopped, false} ->
585585
E({absent, Q, stopped});
586-
{_, true} ->
587-
case rabbit_mnesia:is_process_alive(QPid) of
588-
true ->
589-
% rabbitmq-server#1682 - No need to sleep if the
590-
% queue process has become active in the time between
591-
% the case statement above (in with/4) and now
592-
ok;
593-
false ->
594-
timer:sleep(30)
595-
end,
596-
with(Name, F, E, RetriesLeft - 1);
597586
_ ->
598587
case rabbit_mnesia:is_process_alive(QPid) of
599588
true ->
600-
% rabbitmq-server#1682 - absent & alive is weird,
589+
% rabbitmq-server#1682
590+
% The old check would have crashed here,
591+
% instead, log it and run the exit fun. absent & alive is weird,
601592
% but better than crashing with badmatch,true
593+
rabbit_log:debug("Unexpected alive queue process ~p~n", [QPid]),
602594
E({absent, Q, alive});
603595
false ->
604-
timer:sleep(30),
605-
with(Name, F, E, RetriesLeft - 1)
606-
end
596+
ok % Expected result
597+
end,
598+
timer:sleep(30),
599+
with(Name, F, E, RetriesLeft - 1)
607600
end.
608601

609602
with(Name, F) -> with(Name, F, fun (E) -> {error, E} end).

0 commit comments

Comments
 (0)