diff options
| author | Matthias Radestock <matthias@rabbitmq.com> | 2013-12-12 12:01:15 +0000 |
|---|---|---|
| committer | Matthias Radestock <matthias@rabbitmq.com> | 2013-12-12 12:01:15 +0000 |
| commit | 30cbee1ec392dac0749ddab8b8b472b2ab192c5a (patch) | |
| tree | 479f4a0159db28c15226f09251516c5b6b49eae6 | |
| parent | 808120d5aac49dd26cc67168313f4903e7fadd3e (diff) | |
| download | rabbitmq-server-git-30cbee1ec392dac0749ddab8b8b472b2ab192c5a.tar.gz | |
correct handling of channel_cleanup return value
plus some cosmetics in the area
| -rw-r--r-- | src/rabbit_reader.erl | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/rabbit_reader.erl b/src/rabbit_reader.erl index d4ae9655d4..bece519456 100644 --- a/src/rabbit_reader.erl +++ b/src/rabbit_reader.erl @@ -520,17 +520,18 @@ wait_for_channel_termination(0, TimerRef, _State) -> wait_for_channel_termination(N, TimerRef, State) -> receive {'DOWN', _MRef, process, ChPid, Reason} -> - case {channel_cleanup(ChPid, State), termination_kind(Reason)} of - {undefined, _} -> - exit({abnormal_dependent_exit, ChPid, Reason}); - {_Channel, controlled} -> - wait_for_channel_termination(N-1, TimerRef, State); - {Channel, uncontrolled} -> - log(error, - "AMQP connection ~p, channel ~p - " - "error while terminating:~n~p~n", - [self(), Channel, Reason]), - wait_for_channel_termination(N-1, TimerRef, State) + {Channel, State1} = channel_cleanup(ChPid, State), + case {Channel, termination_kind(Reason)} of + {undefined, _} -> exit({abnormal_dependent_exit, + ChPid, Reason}); + {_, controlled} -> wait_for_channel_termination( + N-1, TimerRef, State1); + {_, uncontrolled} -> log(error, + "AMQP connection ~p, channel ~p - " + "error while terminating:~n~p~n", + [self(), Channel, Reason]), + wait_for_channel_termination( + N-1, TimerRef, State1) end; cancel_wait -> exit(channel_termination_timeout) |
