[erlang-questions] SSL process leak after alert?

Roger Lipscombe roger@REDACTED
Sat Feb 17 12:24:40 CET 2018


On 16 February 2018 at 15:03, Roger Lipscombe <roger@REDACTED> wrote:
> (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.

It's essentially the same as
https://github.com/ninenines/ranch/blob/master/examples/tcp_reverse/src/reverse_protocol.erl,
but with the SSL transport and a slightly more complicated protocol
than "echo" :)

> I see some packets sent from the client in Wireshark, and then an SSL
> alert.

I should note that the "client" is an IoT device with flaky ...
something. Could be Wifi, RAM, something else. It could be a dodgy
router between it and us, for example. It's one of N identical devices
(where N is a large but confidential number), all the rest of which
are working fine. It's just that this one -- which I have no access
to, just an IP address -- is causing this process leak on my server.



More information about the erlang-questions mailing list