Skip to content

Commit 764fe2f

Browse files
committed
gbn: increase NACK wait time by 2X
1 parent f8b3ddf commit 764fe2f

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

gbn/gbn_conn.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -763,9 +763,16 @@ func (g *GoBackNConn) receivePacketsForever() error { // nolint:gocyclo
763763

764764
// If we recently sent a NACK for the same
765765
// sequence number then back off.
766+
// We wait 2 times the resendTimeout before
767+
// sending a new nack, as this case is likely
768+
// hit if the sender is currently resending
769+
// the queue, and therefore the threads that
770+
// are resending the queue is likely busy with
771+
// the resend, and therefore won't react to the
772+
// NACK we send here in time.
766773
if lastNackSeq == g.recvSeq &&
767-
time.Since(lastNackTime) < g.resendTimeout {
768-
log.Tracef("%d recently sent NACK for %d", g.seqTest2, m.Seq)
774+
time.Since(lastNackTime) < g.resendTimeout*2 {
775+
log.Tracef("Recently sent NACK")
769776
continue
770777
}
771778

0 commit comments

Comments
 (0)