Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement pion commit 2184 - mux: drop packets when buffer is full #516

Conversation

stuqdog
Copy link
Contributor

@stuqdog stuqdog commented Nov 21, 2023

This PR implements pion commit 2184.

Currently it's assumed that the read buffer will never fill, and so any failure to write should be cause to return an Err. This isn't always true however, particularly in high load scenarios. Per pion fixes, we should instead log and drop packets when the buffer is full, and continue to return an error in other failure cases.

See pion/webrtc#2152 and pion/webrtc#2180 for more details.

Copy link

codecov bot commented Nov 21, 2023

Codecov Report

Attention: 5 lines in your changes are missing coverage. Please review.

Comparison is base (7d09375) 61.52% compared to head (ed92484) 61.53%.

Files Patch % Lines
webrtc/src/mux/mux_test.rs 64.28% 0 Missing and 5 partials ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master     #516   +/-   ##
=======================================
  Coverage   61.52%   61.53%           
=======================================
  Files         529      529           
  Lines       48866    48878   +12     
  Branches    12375    12381    +6     
=======================================
+ Hits        30067    30079   +12     
+ Misses       9593     9591    -2     
- Partials     9206     9208    +2     

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

Comment on lines 1994 to 2005
log::debug!("s.read_sctp begin");
match s0.read_sctp(&mut buf).await {
Ok((0, PayloadProtocolIdentifier::Unknown)) => {
log::debug!("s0.read_sctp EOF");
let _ = done_ch_tx0.send(Some(Error::ErrEof)).await;
}
Ok(_) => {
panic!("must be error");
}
Err(err) => {
log::debug!("s0.read_sctp err {:?}", err);
let _ = done_ch_tx0.send(Some(err)).await;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(flyby) clippy was complaining that this loop never actually looped, so I removed it.

@rainliu rainliu merged commit aba5218 into webrtc-rs:master Dec 4, 2023
5 checks passed
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.

2 participants