Skip to content

Conversation

@jiajieli-dev
Copy link
Contributor

Reduce log noise for expected "no frame available" errors

Problem

The logs were being spammed with ERROR-level messages like:

ERROR: 2026/01/21 10:59:21 Error processing track camera_feed_11: no frame available

This occurs during normal operation when the encoding loop runs but no frame has arrived within the 100ms timeout window. It's expected behavior during timing gaps between frames, not an actual error condition.

Solution

Differentiate between expected and unexpected errors in the track processing loop:

  • ErrNoFrameAvailable: Now logged at Debug level (silenced by default)
  • All other errors: Remain at Error level

Changes

sender/rtc_sender.go: Added error type check using errors.Is() to log ErrNoFrameAvailable at debug level while preserving error-level logging for actual failures.

Impact

  • Significantly reduces log noise during normal streaming operation
  • Real errors remain visible at ERROR level
  • Debug-level logging still available if needed for troubleshooting

@codecov
Copy link

codecov bot commented Jan 21, 2026

Codecov Report

❌ Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 33.33%. Comparing base (9d4b48f) to head (6590ea6).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
sender/rtc_sender.go 0.00% 4 Missing ⚠️

❌ Your patch status has failed because the patch coverage (0.00%) is below the target coverage (70.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #128      +/-   ##
==========================================
- Coverage   33.39%   33.33%   -0.07%     
==========================================
  Files          18       18              
  Lines        1542     1545       +3     
==========================================
  Hits          515      515              
- Misses        981      984       +3     
  Partials       46       46              
Flag Coverage Δ
go 33.33% <0.00%> (-0.07%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jiajieli-dev jiajieli-dev changed the title Reduce log noise for expected 'no frame available' errors Reduce log noise for 'no frame available' Jan 21, 2026
@jiajieli-dev jiajieli-dev force-pushed the jiajie-reduce-log-noise branch from 4280caa to 3daf707 Compare January 21, 2026 21:26
@jiajieli-dev jiajieli-dev changed the title Reduce log noise for 'no frame available' Log ErrNoFrameAvailable at debug level Jan 21, 2026
@jiajieli-dev jiajieli-dev force-pushed the jiajie-reduce-log-noise branch from 3daf707 to 6590ea6 Compare January 21, 2026 22:00
@jiajieli-dev jiajieli-dev merged commit e87e37e into master Jan 21, 2026
18 of 19 checks passed
@jiajieli-dev jiajieli-dev deleted the jiajie-reduce-log-noise branch January 21, 2026 22:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants