diff options
| author | Michael Bridgen <mikeb@lshift.net> | 2009-10-20 14:05:54 +0100 |
|---|---|---|
| committer | Michael Bridgen <mikeb@lshift.net> | 2009-10-20 14:05:54 +0100 |
| commit | 761f1c51f163b44a81d2f9b8a65eeb7794e54aed (patch) | |
| tree | 2b650f2ea56a6e2b0f1676cc665f636222c83bb7 /src | |
| parent | 626cb737b63644a97d0e62aa54005b4c816ac8ca (diff) | |
| download | rabbitmq-server-git-761f1c51f163b44a81d2f9b8a65eeb7794e54aed.tar.gz | |
Use a specialised return value for handle_ch_down, rather than reinterpreting what used to be a handle_call return value
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_amqqueue_process.erl | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/rabbit_amqqueue_process.erl b/src/rabbit_amqqueue_process.erl index 477484c1a8..02614fbafa 100644 --- a/src/rabbit_amqqueue_process.erl +++ b/src/rabbit_amqqueue_process.erl @@ -321,8 +321,8 @@ handle_ch_down(DownPid, State = #q{exclusive_consumer = Holder}) -> blocked_consumers = remove_consumers( ChPid, State#q.blocked_consumers)}), case should_auto_delete(NewState) of - false -> noreply(NewState); - true -> {stop, normal, NewState} + false -> {ok, NewState}; + true -> {stop, NewState} end end. @@ -576,16 +576,16 @@ handle_call({commit, Txn}, From, State) -> erase_tx(Txn), noreply(NewState); -handle_call({notify_down, ChPid}, From, State) -> +handle_call({notify_down, ChPid}, _From, State) -> %% we want to do this synchronously, so that auto_deleted queues %% are no longer visible by the time we send a response to the %% client. The queue is ultimately deleted in terminate/2; if we %% return stop with a reply, terminate/2 will be called by %% gen_server/2 *before* the reply is sent. case handle_ch_down(ChPid, State) of - {noreply, NewState, Timeout} -> - {reply, ok, NewState, Timeout}; - {stop, normal, NewState2} -> + {ok, NewState} -> + reply(ok, NewState); + {stop, NewState2} -> {stop, normal, ok, NewState2} end; @@ -821,7 +821,10 @@ handle_info({'DOWN', MonitorRef, process, DownPid, _Reason}, NewState = State#q{owner = none}, {stop, normal, NewState}; handle_info({'DOWN', _MonitorRef, process, DownPid, _Reason}, State) -> - handle_ch_down(DownPid, State); + case handle_ch_down(DownPid, State) of + {ok, NewState} -> noreply(NewState); + {stop, NewState2} -> {stop, normal, NewState2} + end; handle_info(Info, State) -> ?LOGDEBUG("Info in queue: ~p~n", [Info]), |
