summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Bakken <lbakken@pivotal.io>2018-12-14 10:57:20 -0800
committerLuke Bakken <lbakken@pivotal.io>2018-12-14 10:57:20 -0800
commit0be4ac363e5b65eeedfda89d4cb681dfb97e2c7f (patch)
treec1676246d23b7ed3dddb984187e3d46e44da72db
parent2f88068b273a3385e3fb818ec378bef3baa7e850 (diff)
downloadrabbitmq-server-git-0be4ac363e5b65eeedfda89d4cb681dfb97e2c7f.tar.gz
Simplify to basically removing the pattern match that crashes
-rw-r--r--src/rabbit_amqqueue.erl23
1 files changed, 8 insertions, 15 deletions
diff --git a/src/rabbit_amqqueue.erl b/src/rabbit_amqqueue.erl
index 53cacdb2e6..d938bece8c 100644
--- a/src/rabbit_amqqueue.erl
+++ b/src/rabbit_amqqueue.erl
@@ -583,27 +583,20 @@ retry_wait(Q = #amqqueue{pid = QPid, name = Name, state = QState}, F, E, Retries
%% there are no slaves to migrate to
{stopped, false} ->
E({absent, Q, stopped});
- {_, true} ->
- case rabbit_mnesia:is_process_alive(QPid) of
- true ->
- % rabbitmq-server#1682 - No need to sleep if the
- % queue process has become active in the time between
- % the case statement above (in with/4) and now
- ok;
- false ->
- timer:sleep(30)
- end,
- with(Name, F, E, RetriesLeft - 1);
_ ->
case rabbit_mnesia:is_process_alive(QPid) of
true ->
- % rabbitmq-server#1682 - absent & alive is weird,
+ % rabbitmq-server#1682
+ % The old check would have crashed here,
+ % instead, log it and run the exit fun. absent & alive is weird,
% but better than crashing with badmatch,true
+ rabbit_log:debug("Unexpected alive queue process ~p~n", [QPid]),
E({absent, Q, alive});
false ->
- timer:sleep(30),
- with(Name, F, E, RetriesLeft - 1)
- end
+ ok % Expected result
+ end,
+ timer:sleep(30),
+ with(Name, F, E, RetriesLeft - 1)
end.
with(Name, F) -> with(Name, F, fun (E) -> {error, E} end).