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
564
564
565
565
// If we recently sent a NACK for the same
566
566
// 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" )
570
580
571
581
continue
572
582
}
You can’t perform that action at this time.
0 commit comments