Skip to content

Commit b43de46

Browse files
committed
Take "true" case into consideration
Fixes #1682
1 parent 526ec37 commit b43de46

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/rabbit_amqqueue.erl

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -506,8 +506,15 @@ retry_wait(Q = #amqqueue{pid = QPid, name = Name, state = QState}, F, E, Retries
506506
{stopped, false} ->
507507
E({absent, Q, stopped});
508508
_ ->
509-
false = rabbit_mnesia:is_process_alive(QPid),
510-
timer:sleep(30),
509+
case rabbit_mnesia:is_process_alive(QPid) of
510+
true ->
511+
% rabbitmq-server#1682 - No need to sleep if the
512+
% queue process has become active in the time between
513+
% the case statement above (in with/4) and now
514+
ok;
515+
false ->
516+
timer:sleep(30)
517+
end,
511518
with(Name, F, E, RetriesLeft - 1)
512519
end.
513520

0 commit comments

Comments
 (0)