1
0
Fork 0
mirror of https://github.com/processone/ejabberd synced 2025-10-03 09:49:18 +02:00

ejabberd_listener: Let supervisor terminate child

If a TCP connection was closed before the socket was handed over to a
supervised child process, let the supervisor terminate the process
rather than killing it directly.  This avoids crash log entries
generated by the supervisor.
This commit is contained in:
Holger Weiss 2020-05-05 17:22:52 +02:00
parent 865074603c
commit 5649e35a64

View file

@ -307,7 +307,12 @@ start_connection(Module, Arity, Socket, State, Sup) ->
Module:accept(Pid), Module:accept(Pid),
{ok, Pid}; {ok, Pid};
Err -> Err ->
exit(Pid, kill), case Sup of
undefined ->
exit(Pid, kill);
_ ->
supervisor:terminate_child(Sup, Pid)
end,
Err Err
end; end;
Err -> Err ->