File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -564,9 +564,19 @@ func (g *GoBackNConn) receivePacketsForever() error { // nolint:gocyclo
564564
565565 // If we recently sent a NACK for the same
566566 // sequence number then back off.
567- if lastNackSeq == g .recvSeq &&
568- time .Since (lastNackTime ) <
569- g .cfg .resendTimeout {
567+ // We wait 2 times the resendTimeout before
568+ // sending a new nack, as this case is likely
569+ // hit if the sender is currently resending
570+ // the queue, and therefore the threads that
571+ // are resending the queue is likely busy with
572+ // the resend, and therefore won't react to the
573+ // NACK we send here in time.
574+ sinceSent := time .Since (lastNackTime )
575+ recentlySent := sinceSent <
576+ g .cfg .resendTimeout * 2
577+
578+ if lastNackSeq == g .recvSeq && recentlySent {
579+ g .log .Tracef ("Recently sent NACK" )
570580
571581 continue
572582 }
You can’t perform that action at this time.
0 commit comments