:ssl_closed message received during web API calls

I am seeing this in my log:

...
    (stdlib 3.7.1) gen_server.erl:637: :gen_server.try_dispatch/4
    (stdlib 3.7.1) gen_server.erl:711: :gen_server.handle_msg/6
    (stdlib 3.7.1) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
Last message: {:ssl_closed, {:sslsocket, {:gen_tcp, #Port<0.156>, :tls_connection, :undefined}, [#PID<0.2810.0>, #PID<0.2809.0>]}}

And the process crashed. The process was doing some outbound web api calls with HTTPosion prior to the crash, and I guess it hit some tricky spot. I understand web API can fail, however, why does it fail this way? and am I supposed to catch this?

1 Like

The messages look like the ones in this Hackney bug:

I’ve seen these infrequently in production (one per thousands of outgoing HTTP requests) so it’s hard to troubleshoot, but AFAIK they are “leftovers” from previously-used connections and don’t affect operations. To stop them crashing my GenServers, I added a handle_info that logged about it and went on with life.

2 Likes