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 @@ -579,8 +579,18 @@ func (g *GoBackNConn) receivePacketsForever() error { // nolint:gocyclo
579579
580580 // If we recently sent a NACK for the same
581581 // sequence number then back off.
582- if lastNackSeq == g .recvSeq &&
583- time .Since (lastNackTime ) < g .resendTimeout {
582+ // We wait 2 times the resendTimeout before
583+ // sending a new nack, as this case is likely
584+ // hit if the sender is currently resending
585+ // the queue, and therefore the threads that
586+ // are resending the queue is likely busy with
587+ // the resend, and therefore won't react to the
588+ // NACK we send here in time.
589+ sinceSent := time .Since (lastNackTime )
590+ recentlySent := sinceSent < g .resendTimeout * 2 //nolint:gomnd
591+
592+ if lastNackSeq == g .recvSeq && recentlySent {
593+ log .Tracef ("Recently sent NACK" )
584594
585595 continue
586596 }
You can’t perform that action at this time.
0 commit comments