aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorErlang/OTP <[email protected]>2018-06-28 17:08:55 +0200
committerErlang/OTP <[email protected]>2018-06-28 17:08:55 +0200
commit0c77843558fd4e4fbd88b5ff2d4f3a359f793f3f (patch)
tree5a31b6c4f923f352363837105baf5db5530eaf79 /lib
parentaa490b13a7f98e54c48fea3537f02614f1145ffc (diff)
parent366fe98c3f685595c5b4e9c6cb19d1034d7b24f6 (diff)
downloadotp-0c77843558fd4e4fbd88b5ff2d4f3a359f793f3f.tar.gz
otp-0c77843558fd4e4fbd88b5ff2d4f3a359f793f3f.tar.bz2
otp-0c77843558fd4e4fbd88b5ff2d4f3a359f793f3f.zip
Merge branch 'sverker/kernel/tick-fixes/OTP-15162' into maint-20
* sverker/kernel/tick-fixes/OTP-15162: kernel: Fix tick count bug when pending writes kernel: Send tick to hidden node even if pending writes
Diffstat (limited to 'lib')
-rw-r--r--lib/kernel/src/dist_util.erl19
1 files changed, 10 insertions, 9 deletions
diff --git a/lib/kernel/src/dist_util.erl b/lib/kernel/src/dist_util.erl
index b3507e5d13..d80971f414 100644
--- a/lib/kernel/src/dist_util.erl
+++ b/lib/kernel/src/dist_util.erl
@@ -731,7 +731,7 @@ send_status(#hs_data{socket = Socket, other_node = Node,
%% The detection time interval is thus, by default, 45s < DT < 75s
-%% A HIDDEN node is always (if not a pending write) ticked if
+%% A HIDDEN node is always ticked if
%% we haven't read anything as a hidden node only ticks when it receives
%% a TICK !!
@@ -745,17 +745,17 @@ send_tick(Socket, Tick, Type, MFTick, MFGetstat) ->
case MFGetstat(Socket) of
{ok, Read, _, _} when Ticked =:= T ->
{error, not_responding};
- {ok, Read, W, Pend} when Type =:= hidden ->
- send_tick(Socket, Pend, MFTick),
+ {ok, Read, W, _} when Type =:= hidden ->
+ MFTick(Socket),
{ok, Tick#tick{write = W + 1,
tick = T1}};
{ok, Read, Write, Pend} ->
- send_tick(Socket, Pend, MFTick),
- {ok, Tick#tick{write = Write + 1,
+ Sent = send_tick(Socket, Pend, MFTick),
+ {ok, Tick#tick{write = Write + Sent,
tick = T1}};
{ok, R, Write, Pend} ->
- send_tick(Socket, Pend, MFTick),
- {ok, Tick#tick{write = Write + 1,
+ Sent = send_tick(Socket, Pend, MFTick),
+ {ok, Tick#tick{write = Write + Sent,
read = R,
tick = T1,
ticked = T}};
@@ -772,10 +772,11 @@ send_tick(Socket, Tick, Type, MFTick, MFGetstat) ->
end.
send_tick(Socket, 0, MFTick) ->
- MFTick(Socket);
+ MFTick(Socket),
+ 1;
send_tick(_, _Pend, _) ->
%% Dont send tick if pending write.
- ok.
+ 0.
%% ------------------------------------------------------------
%% Connection setup timeout timer.