Skip to content

Commit

Permalink
gbn: increase NACK wait time by 2X
Browse files Browse the repository at this point in the history
  • Loading branch information
ViktorTigerstrom committed Nov 7, 2023
1 parent 893b879 commit 57e30f5
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions gbn/gbn_conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -652,9 +652,16 @@ func (g *GoBackNConn) receivePacketsForever() error { // nolint:gocyclo

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

Expand Down

0 comments on commit 57e30f5

Please sign in to comment.