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 @@ -553,9 +553,19 @@ func (g *GoBackNConn) receivePacketsForever() error { // nolint:gocyclo
553553
554554 // If we recently sent a NACK for the same
555555 // sequence number then back off.
556- if lastNackSeq == g .recvSeq &&
557- time .Since (lastNackTime ) <
558- g .cfg .resendTimeout {
556+ // We wait 2 times the resendTimeout before
557+ // sending a new nack, as this case is likely
558+ // hit if the sender is currently resending
559+ // the queue, and therefore the threads that
560+ // are resending the queue is likely busy with
561+ // the resend, and therefore won't react to the
562+ // NACK we send here in time.
563+ sinceSent := time .Since (lastNackTime )
564+ recentlySent := sinceSent <
565+ g .cfg .resendTimeout * 2
566+
567+ if lastNackSeq == g .recvSeq && recentlySent {
568+ g .log .Tracef ("Recently sent NACK" )
559569
560570 continue
561571 }
You can’t perform that action at this time.
0 commit comments