diff options
| author | Matthias Radestock <matthias@rabbitmq.com> | 2014-02-06 20:11:50 +0000 |
|---|---|---|
| committer | Matthias Radestock <matthias@rabbitmq.com> | 2014-02-06 20:11:50 +0000 |
| commit | a30b391098fe92ae34b80440a842ce1eb26ca608 (patch) | |
| tree | 4a15a67ed9d4595272fb0cfc12ce0c2391de62ca | |
| parent | 5a69daa6f29858bf046af426472a287ef570d67a (diff) | |
| download | rabbitmq-server-git-a30b391098fe92ae34b80440a842ce1eb26ca608.tar.gz | |
bail on coding bug
| -rw-r--r-- | src/rabbit_amqqueue.erl | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/rabbit_amqqueue.erl b/src/rabbit_amqqueue.erl index 346d57a8e6..2b86435d28 100644 --- a/src/rabbit_amqqueue.erl +++ b/src/rabbit_amqqueue.erl @@ -354,14 +354,14 @@ with(Name, F, E) -> {ok, Q = #amqqueue{pid = QPid}} -> %% We check is_process_alive(QPid) in case we receive a %% nodedown (for example) in F() that has nothing to do - %% with the QPid. + %% with the QPid. F() should be written s.t. that this + %% cannot happen, so we bail if it does since that + %% indicates a code bug and we don't want to get stuck in + %% the retry loop. rabbit_misc:with_exit_handler( - fun () -> - case rabbit_misc:is_process_alive(QPid) of - true -> E(not_found_or_absent_dirty(Name)); - false -> timer:sleep(25), - with(Name, F, E) - end + fun () -> false = rabbit_misc:is_process_alive(QPid), + timer:sleep(25), + with(Name, F, E) end, fun () -> F(Q) end); {error, not_found} -> E(not_found_or_absent_dirty(Name)) |
