From dacd349d6fb4fc7453b1fbf694158fd25496ed42 Mon Sep 17 00:00:00 2001 From: Bhasker Hariharan Date: Fri, 10 Jan 2020 06:01:10 -0800 Subject: [PATCH] panic fix in retransmitTimerExpired. This is a band-aid fix for now to prevent panics. PiperOrigin-RevId: 289078453 --- pkg/tcpip/transport/tcp/snd.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkg/tcpip/transport/tcp/snd.go b/pkg/tcpip/transport/tcp/snd.go index 79f2d274b..fdff7ed81 100644 --- a/pkg/tcpip/transport/tcp/snd.go +++ b/pkg/tcpip/transport/tcp/snd.go @@ -442,6 +442,13 @@ func (s *sender) retransmitTimerExpired() bool { return true } + // TODO(b/147297758): Band-aid fix, retransmitTimer can fire in some edge cases + // when writeList is empty. Remove this once we have a proper fix for this + // issue. + if s.writeList.Front() == nil { + return true + } + s.ep.stack.Stats().TCP.Timeouts.Increment() s.ep.stats.SendErrors.Timeouts.Increment()