From 6619e17dd7f5f86efefa5f2f55aef4bba0eb806c Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Sun, 4 Jun 2023 22:29:40 +0300 Subject: [PATCH] ackhandler: don't log / trace skipped packets when declaring them lost (#3887) --- internal/ackhandler/sent_packet_handler.go | 24 +++++++++++++--------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/internal/ackhandler/sent_packet_handler.go b/internal/ackhandler/sent_packet_handler.go index 4dade35e..88378d6d 100644 --- a/internal/ackhandler/sent_packet_handler.go +++ b/internal/ackhandler/sent_packet_handler.go @@ -592,19 +592,23 @@ func (h *sentPacketHandler) detectLostPackets(now time.Time, encLevel protocol.E var packetLost bool if p.SendTime.Before(lostSendTime) { packetLost = true - if h.logger.Debug() { - h.logger.Debugf("\tlost packet %d (time threshold)", p.PacketNumber) - } - if h.tracer != nil { - h.tracer.LostPacket(p.EncryptionLevel, p.PacketNumber, logging.PacketLossTimeThreshold) + if !p.skippedPacket { + if h.logger.Debug() { + h.logger.Debugf("\tlost packet %d (time threshold)", p.PacketNumber) + } + if h.tracer != nil { + h.tracer.LostPacket(p.EncryptionLevel, p.PacketNumber, logging.PacketLossTimeThreshold) + } } } else if pnSpace.largestAcked >= p.PacketNumber+packetThreshold { packetLost = true - if h.logger.Debug() { - h.logger.Debugf("\tlost packet %d (reordering threshold)", p.PacketNumber) - } - if h.tracer != nil { - h.tracer.LostPacket(p.EncryptionLevel, p.PacketNumber, logging.PacketLossReorderingThreshold) + if !p.skippedPacket { + if h.logger.Debug() { + h.logger.Debugf("\tlost packet %d (reordering threshold)", p.PacketNumber) + } + if h.tracer != nil { + h.tracer.LostPacket(p.EncryptionLevel, p.PacketNumber, logging.PacketLossReorderingThreshold) + } } } else if pnSpace.lossTime.IsZero() { // Note: This conditional is only entered once per call