chore(channel): remove redundant logs

Multiple sock_closed events may be generated,
so we need to allow sock_closed events to be reentrant
This commit is contained in:
JianBo He 2021-10-29 18:46:07 +08:00
parent 8526032200
commit c9d39b4d35
1 changed files with 5 additions and 2 deletions

View File

@ -977,8 +977,11 @@ handle_info({sock_closed, Reason}, Channel =
Shutdown -> Shutdown Shutdown -> Shutdown
end; end;
handle_info({sock_closed, Reason}, Channel = #channel{conn_state = disconnected}) -> handle_info({sock_closed, _Reason}, Channel = #channel{conn_state = disconnected}) ->
?LOG(error, "Unexpected sock_closed: ~p", [Reason]), %% Since sock_closed messages can be generated multiple times,
%% we can simply ignore errors of this type in the disconnected state.
%% e.g. when the socket send function returns an error, there is already
%% a tcp_closed delivered to the process mailbox
{ok, Channel}; {ok, Channel};
handle_info(clean_acl_cache, Channel) -> handle_info(clean_acl_cache, Channel) ->