Drop error logs due to pipe close (#1813)

This commit is contained in:
Raja Subramanian
2023-06-21 14:11:17 +05:30
committed by GitHub
parent c12e15ff52
commit 2438058474
3 changed files with 7 additions and 14 deletions
+1 -9
View File
@@ -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