Skip to content

Commit c5c857c

Browse files
committed
kernel: Fix send_timeout_active deadlock on large socket buffers
Adjust send buffer similarly to 300fefe to avoid live-lock.
1 parent 31df515 commit c5c857c

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

lib/kernel/test/gen_tcp_misc_SUITE.erl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7121,12 +7121,14 @@ oki({ok, V}) -> V;
71217121
oki(E) -> E.
71227122

71237123
setup_active_timeout_sink(Config, RNode, Addr, Timeout, AutoClose) ->
7124+
BufSz = 16 * 1024,
71247125
ListenOpts = [binary,
71257126
{ifaddr, Addr},
71267127
{active, false},
71277128
{packet, 0},
71287129
{nodelay, true},
71297130
{keepalive, true},
7131+
{sndbuf, BufSz},
71307132
{send_timeout, Timeout},
71317133
{send_timeout_close, AutoClose}],
71327134
{ok, L} = ?LISTEN(Config, 0, ListenOpts),
@@ -7147,7 +7149,9 @@ setup_active_timeout_sink(Config, RNode, Addr, Timeout, AutoClose) ->
71477149
end,
71487150
{ok, C} = Remote(fun() ->
71497151
?CONNECT(Config, Addr, Port, [{ip, Addr},
7150-
{active, false}])
7152+
{active, false},
7153+
{recbuf, BufSz div 2},
7154+
{sndbuf, BufSz div 2}])
71517155
end),
71527156
{ok, A} = gen_tcp:accept(L),
71537157
gen_tcp:send(A, "Hello"),

0 commit comments

Comments
 (0)