Skip to content

Fix for read messages getting stuck in PeerConnection queues - #256

Open
cuchaz wants to merge 3 commits into
webrtc-rs:masterfrom
cuchaz:stuck-reads
Open

cuchaz wants to merge 3 commits into
webrtc-rs:masterfrom
cuchaz:stuck-reads

Conversation

@cuchaz

@cuchaz cuchaz commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

If read messages are created by handle_event() in a handler and placed into the read outs queue, those messages will not reach the endpoint handler until the next call to RTCPeerConnection::handle_read() (ie, when next incoming packet is processed). This can cause read messages to get 'stuck' in the queues until an incoming packet arrives.

Specifically, I've observed this happening to channel open messages for negotiated data channels, but it's possible other messages are affected as well.

This PR fixes the issue by also allowing RTCPeerConnection::poll_reads() to 'pump' the read queue in the same way that handle_read() does by creating a shared pump_reads() function that both poll_read() and handle_read() can call.

@codecov

codecov Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.79%. Comparing base (784e464) to head (240fdb0).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #256      +/-   ##
==========================================
- Coverage   87.85%   87.79%   -0.06%     
==========================================
  Files         499      499              
  Lines       72540    72545       +5     
==========================================
- Hits        63728    63692      -36     
- Misses       8812     8853      +41     
Flag Coverage Δ
aws-lc-rs 87.63% <100.00%> (-0.06%) ⬇️
ring 87.78% <100.00%> (+<0.01%) ⬆️

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

☔ View full report in Codecov by Harness.
📢 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.

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.

1 participant