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 @@ -561,9 +561,19 @@ func (g *GoBackNConn) receivePacketsForever() error { // nolint:gocyclo
561561
562562 // If we recently sent a NACK for the same
563563 // sequence number then back off.
564- if lastNackSeq == g .recvSeq &&
565- time .Since (lastNackTime ) <
566- g .cfg .resendTimeout {
564+ // We wait 2 times the resendTimeout before
565+ // sending a new nack, as this case is likely
566+ // hit if the sender is currently resending
567+ // the queue, and therefore the threads that
568+ // are resending the queue is likely busy with
569+ // the resend, and therefore won't react to the
570+ // NACK we send here in time.
571+ sinceSent := time .Since (lastNackTime )
572+ recentlySent := sinceSent <
573+ g .cfg .resendTimeout * 2
574+
575+ if lastNackSeq == g .recvSeq && recentlySent {
576+ g .log .Tracef ("Recently sent NACK" )
567577
568578 continue
569579 }
You can’t perform that action at this time.
0 commit comments