-
Notifications
You must be signed in to change notification settings - Fork 3k
Description
Describe the bug
I've been looking at inet_tls_dist and noticed the following behavior.
A recent patch changed inet_tls_dist to do the TLS handshake in subprocesses: 14bc45e. If the subprocess receives an error from the call to inet_tcp:accept(), it exits. This in turn terminates the acceptor. But it is possible that one of the other subprocesses has just sent an {accept, ...} message to net_kernel here. This process will get killed as well. When handling the {accept,...} message, net_kernel will spawn a new process via inet_tls_dist:accept_connection() and tell AcceptPid to pass the socket to the new process. But by this point AcceptPid is either dead or about to die, and so it will never pass the socket and unblock the accept_connection() process. As far as I can tell, there's no code that would clean these processes up once net_kernel receives the EXIT message from the acceptor.
To Reproduce
Found via code inspection, I have not attempted reproducing it.
Expected behavior
There should be no leak.
Affected versions
OTP-24.1.3