diff options
| author | Matthew Sackman <matthew@rabbitmq.com> | 2010-08-09 17:09:17 +0100 |
|---|---|---|
| committer | Matthew Sackman <matthew@rabbitmq.com> | 2010-08-09 17:09:17 +0100 |
| commit | c07d794336faaf65da3a3f3cc8e00150cb6fe95e (patch) | |
| tree | ad78c926b04f45a8ea5938d05302e0807b930c03 /src | |
| parent | 1f8bdc699e5a3ba3690d989982a0a87c18a26a83 (diff) | |
| download | rabbitmq-server-git-c07d794336faaf65da3a3f3cc8e00150cb6fe95e.tar.gz | |
Flush the writer much earlier on, allowing the actual termination to be less risky
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_channel.erl | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/rabbit_channel.erl b/src/rabbit_channel.erl index f8d4f3076f..e93b666539 100644 --- a/src/rabbit_channel.erl +++ b/src/rabbit_channel.erl @@ -202,7 +202,8 @@ handle_cast({method, Method, Content}, State) -> noreply(NewState); {noreply, NewState} -> noreply(NewState); - stop -> + flush_and_stop -> + rabbit_writer:flush(State#ch.writer_pid), {stop, normal, State#ch{state = terminating}} catch exit:Reason = #amqp_error{} -> @@ -409,7 +410,7 @@ handle_method(_Method, _, #ch{state = starting}) -> handle_method(#'channel.close'{}, _, State = #ch{writer_pid = WriterPid}) -> ok = rollback_and_notify(State), ok = rabbit_writer:send_command(WriterPid, #'channel.close_ok'{}), - stop; + flush_and_stop; handle_method(#'access.request'{},_, State) -> {reply, #'access.request_ok'{ticket = 1}, State}; @@ -1099,10 +1100,9 @@ internal_deliver(WriterPid, Notify, ConsumerTag, DeliveryTag, false -> rabbit_writer:send_command(WriterPid, M, Content) end. -terminate(#ch{writer_pid = WriterPid, limiter_pid = LimiterPid}) -> +terminate(#ch{limiter_pid = LimiterPid}) -> pg_local:leave(rabbit_channels, self()), rabbit_event:notify(channel_closed, [{pid, self()}]), - rabbit_writer:flush(WriterPid), rabbit_limiter:shutdown(LimiterPid). infos(Items, State) -> [{Item, i(Item, State)} || Item <- Items]. |
