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