File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -570,8 +570,18 @@ func (g *GoBackNConn) receivePacketsForever() error { // nolint:gocyclo
570570
571571 // If we recently sent a NACK for the same
572572 // sequence number then back off.
573- if lastNackSeq == g .recvSeq &&
574- time .Since (lastNackTime ) < g .resendTimeout {
573+ // We wait 2 times the resendTimeout before
574+ // sending a new nack, as this case is likely
575+ // hit if the sender is currently resending
576+ // the queue, and therefore the threads that
577+ // are resending the queue is likely busy with
578+ // the resend, and therefore won't react to the
579+ // NACK we send here in time.
580+ sinceSent := time .Since (lastNackTime )
581+ recentlySent := sinceSent < g .resendTimeout * 2 //nolint:gomnd
582+
583+ if lastNackSeq == g .recvSeq && recentlySent {
584+ log .Tracef ("Recently sent NACK" )
575585
576586 continue
577587 }
You can’t perform that action at this time.
0 commit comments