[erlang-questions] SSH ssh_connection.exec/4 too much data too fast?

Rubén Caro <>
Fri Jan 8 18:39:50 CET 2016

Hi fellow erlangers,

I have a question regarding ssh.

If I run something like 'while sleep 0.01; do echo hello; done;' using
'ssh_connection.exec/4' I get its virtually infinite output as a sequence
of 'data' messages (*{ssh_cm, ssh_connection_ref(), {data,
ssh_channel_id(), ssh_data_type_code(), Data :: binary()}}*). No other
message (exit_signal, exit_status, etc.) is expected from an infinite
output like this. Everything works as expected.

If I run something like 'while sleep 0.000001; do echo hello; done;' or
something like 'while true; do echo hello; done;' then I get only a few
messages, but then I stop receiving messages on my process' mailbox. I do
not receive any other message either (exit_signal, exit_status, etc.) .
Complete silence.

I see the remote process is still using CPU (I guess producing output) on
the remote machine _after_ my process stops receiving data messages. After
a few seconds it stops using CPU (I guess stops producing output). Then
everything is stalled. My erlang process not receiving messages, and the
remote process waiting.

This is all being done from an Elixir library, but I've reproduced from
pure Erlang, so no problem from there. You can see it all in

Maybe you can explain these symptoms from your knowledge. Can you help me?

Many thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20160108/9ad650c3/attachment.html>

More information about the erlang-questions mailing list