Repository navigation
fix(libpeer): prevent DTLS receive stalls during stream startup - #37
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (6)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe DTLS path now performs non-blocking single reads, tracks pending data, drains buffered input in ChangesDTLS receive flow
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Bug fix Sequence Diagram(s)sequenceDiagram
participant peer_connection_loop
participant peer_connection_read_dtls
participant dtls_srtp_read
participant SCTP
peer_connection_loop->>peer_connection_read_dtls: process pending or checked SSL input
peer_connection_read_dtls->>dtls_srtp_read: perform one DTLS read
dtls_srtp_read-->>peer_connection_read_dtls: return bytes or status
peer_connection_read_dtls->>SCTP: pass application data
peer_connection_read_dtls-->>peer_connection_loop: update pending data or peer state
Merge Risk: ⚪ Minimal · up to The DTLS receive-flow change has targeted coverage for retries, retained datagrams, buffered records, and connection state transitions. No actionable merge-blocking risk remains. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Addresses a reproducible transport stall relevant to #36. This does not claim hardware confirmation or resolve the separate touch-mapping report.
The DTLS receive callback returned the same cached UDP datagram repeatedly, while
dtls_srtp_readretriedWANT_READ/WANT_WRITEwithout yielding. The network worker holds the peer mutex across this path, preventing UI polling and the startup watchdog from progressing when the read stalls.Both original regression tests fail on the old code and pass with the fix. Added source-level tests cover repeated receive calls, nonblocking read results, retained datagrams through 100 retry iterations, buffered TLS records, interleaved RTP, and close/error handling using controlled TLS and UDP I/O.
Validation: all 65 streaming/transport checks pass normally and under GCC ASan/UBSan, including the real-packet SCTP reliability suite. The supported pinned-container Switch build recompiles both modified dependency objects and produces
SwitchNOW.nro.Hardware acceptance still needs the affected Switch to retry negotiation and first-video startup. No touch-coordinate changes are included.
Summary by CodeRabbit
Bug Fixes
Tests