Skip to content

Commit 57e30f5

Browse files
committed
gbn: increase NACK wait time by 2X
1 parent 893b879 commit 57e30f5

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
@@ -652,9 +652,16 @@ func (g *GoBackNConn) receivePacketsForever() error { // nolint:gocyclo
652652

653653
// If we recently sent a NACK for the same
654654
// sequence number then back off.
655+
// We wait 2 times the resendTimeout before
656+
// sending a new nack, as this case is likely
657+
// hit if the sender is currently resending
658+
// the queue, and therefore the threads that
659+
// are resending the queue is likely busy with
660+
// the resend, and therefore won't react to the
661+
// NACK we send here in time.
655662
if lastNackSeq == g.recvSeq &&
656-
time.Since(lastNackTime) < g.resendTimeout {
657-
log.Tracef("%d recently sent NACK for %d", g.seqTest2, m.Seq)
663+
time.Since(lastNackTime) < g.resendTimeout*2 {
664+
log.Tracef("Recently sent NACK")
658665
continue
659666
}
660667

0 commit comments

Comments
 (0)