panic fix in retransmitTimerExpired.

This is a band-aid fix for now to prevent panics.

PiperOrigin-RevId: 289078453
This commit is contained in:
Bhasker Hariharan 2020-01-10 06:01:10 -08:00 committed by gVisor bot
parent 27500d529f
commit dacd349d6f
1 changed files with 7 additions and 0 deletions

View File

@ -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()