[erlang-questions] SSL process leak after alert?

Roger Lipscombe roger@REDACTED
Fri Feb 16 16:03:05 CET 2018


(re-submitting this now I've got the underlying cause)

Per http://erlang.org/pipermail/erlang-questions/2018-February/094933.html:

I'm using a gen_server with {active, once} handling, with ranch_ssl
(though I don't think ranch is part of the problem), and it's leaking
connection processes. I'm never seeing the 'ssl_closed' message.

My code looks like this:

1. ranch calls my_protocol:start_link.
2. my_protocol:start_link calls proc_lib:spawn_link.
3. my_protocol:init calls ranch:accept_ack. This returns 'ok'.
4. my_protocol:init calls Transport:setopts(Socket, [{active, once}]).
5. my_protocol:init calls gen_server:enter_loop.

I see some packets sent from the client in Wireshark, and then an SSL
alert. In my logs, I see the following:

SSL: {connection,{alert,2,20,{"tls_record.erl",488},undefined}}:
ssl_connection.erl:861:Fatal error: unexpected message

...and the socket is closed (neither netstat nor inet:i() show it),
but my Erlang process never sees an 'ssl_closed' message (or any other
message), so it never dies.

Erlang/OTP 19.3.6.4

Regards,
Roger.



More information about the erlang-questions mailing list