mirror of
https://github.com/livekit/livekit.git
synced 2026-09-17 01:34:51 +00:00
Drop error logs due to pipe close (#1813)
This commit is contained in:
@@ -2,7 +2,6 @@ package rtc
|
||||
|
||||
import (
|
||||
"context"
|
||||
"io"
|
||||
"os"
|
||||
"strconv"
|
||||
"strings"
|
||||
@@ -1390,7 +1389,7 @@ func (p *ParticipantImpl) subscriberRTCPWorker() {
|
||||
pkts = append(pkts, &rtcp.SourceDescription{Chunks: sd})
|
||||
}
|
||||
if err := p.TransportManager.WriteSubscriberRTCP(pkts); err != nil {
|
||||
if err == io.EOF || err == io.ErrClosedPipe {
|
||||
if IsEOF(err) {
|
||||
return
|
||||
}
|
||||
p.params.Logger.Errorw("could not send down track reports", err)
|
||||
@@ -1407,7 +1406,7 @@ func (p *ParticipantImpl) subscriberRTCPWorker() {
|
||||
pkts = append(pkts, &rtcp.SourceDescription{Chunks: sd})
|
||||
}
|
||||
if err := p.TransportManager.WriteSubscriberRTCP(pkts); err != nil {
|
||||
if err == io.EOF || err == io.ErrClosedPipe {
|
||||
if IsEOF(err) {
|
||||
return
|
||||
}
|
||||
p.params.Logger.Errorw("could not send down track reports", err)
|
||||
@@ -1980,7 +1979,9 @@ func (p *ParticipantImpl) publisherRTCPWorker() {
|
||||
}
|
||||
|
||||
if err := p.TransportManager.WritePublisherRTCP(pkts); err != nil {
|
||||
p.params.Logger.Errorw("could not write RTCP to participant", err)
|
||||
if !IsEOF(err) {
|
||||
p.params.Logger.Errorw("could not write RTCP to participant", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -347,7 +347,7 @@ func (s *RTCService) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
websocket.IsCloseError(err, websocket.CloseAbnormalClosure, websocket.CloseGoingAway, websocket.CloseNormalClosure, websocket.CloseNoStatusReceived) {
|
||||
pLogger.Infow("exit ws read loop for closed connection", "connID", cr.ConnectionID, "wsError", err)
|
||||
} else {
|
||||
pLogger.Errorw("error reading from websocket", err)
|
||||
pLogger.Errorw("error reading from websocket", err, "connID", cr.ConnectionID)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
@@ -221,9 +221,6 @@ type DownTrack struct {
|
||||
deltaStatsSnapshotId uint32
|
||||
deltaStatsOverriddenSnapshotId uint32
|
||||
|
||||
// for throttling error logs
|
||||
writeIOErrors atomic.Uint32
|
||||
|
||||
isNACKThrottled atomic.Bool
|
||||
|
||||
activePaddingOnMuteUpTrack atomic.Bool
|
||||
@@ -610,12 +607,7 @@ func (d *DownTrack) WriteRTP(extPkt *buffer.ExtPacket, layer int32) error {
|
||||
|
||||
_, err = d.writeStream.WriteRTP(hdr, payload)
|
||||
if err != nil {
|
||||
if errors.Is(err, io.ErrClosedPipe) {
|
||||
writeIOErrors := d.writeIOErrors.Inc()
|
||||
if (writeIOErrors % 100) == 1 {
|
||||
d.logger.Errorw("write rtp packet failed", err, "count", writeIOErrors)
|
||||
}
|
||||
} else {
|
||||
if !errors.Is(err, io.ErrClosedPipe) {
|
||||
d.logger.Errorw("write rtp packet failed", err)
|
||||
}
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user