fix(emqx_connection): Add backpressure to TCP connections

Fixes #5494
This commit is contained in:
k32 2021-11-04 16:24:47 +01:00
parent aed9ad3f7d
commit 0a5a9bd7d0
1 changed files with 1 additions and 1 deletions

View File

@ -752,7 +752,7 @@ send(IoData, #state{transport = Transport, socket = Socket, channel = Channel})
ok = emqx_metrics:inc('bytes.sent', Oct), ok = emqx_metrics:inc('bytes.sent', Oct),
inc_counter(outgoing_bytes, Oct), inc_counter(outgoing_bytes, Oct),
emqx_congestion:maybe_alarm_conn_congestion(Socket, Transport, Channel), emqx_congestion:maybe_alarm_conn_congestion(Socket, Transport, Channel),
case Transport:async_send(Socket, IoData, [nosuspend]) of case Transport:async_send(Socket, IoData, []) of
ok -> ok; ok -> ok;
Error = {error, _Reason} -> Error = {error, _Reason} ->
%% Send an inet_reply to postpone handling the error %% Send an inet_reply to postpone handling the error