I have some tests in Ranch that get stuck when trying to send data using an ssl socket:
These tests send a 20MB file containing random data, emulating the file:sendfile function with normal sends.
What I can see from an initial look is that:
- The test itself gets stuck when trying to send via ssl:send -> tls_sender:send_data
- The tls_sender process gets stuck with the following stacktrace:
[{prim_inet,send_recv_reply,2,[]}, {tls_sender,send_application_data,4, [{file,"tls_sender.erl"},{line,432}]}, {gen_statem,call_state_function,5, [{file,"gen_statem.erl"},{line,1586}]}, {gen_statem,loop_event_state_function,6, [{file,"gen_statem.erl"},{line,967}]}, {proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,249}]}]
I can see this issue on Arch Linux (local and server), Ubuntu and macOS at the moment, so it's probably not platform-specific.
There was no such problems with OTP-21.3.7, for example: https://builds.ninenines.eu/logs/ranch/120/archlinux/
To reproduce you can do the following:
$ git clone https://github.com/ninenines/ranch
$ cd ranch
$ make ct-sendfile t=ssl:filename ERLANG_OTP=OTP-21.3.8
This will build OTP-21.3.8. If you already have it in the path don't include the ERLANG_OTP variable.