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

Docs: correct OnBufferedAmountLow condition #2474

Merged
merged 1 commit into from
Sep 11, 2023

Conversation

WofWca
Copy link
Contributor

@WofWca WofWca commented May 16, 2023

Description

This is in line with

This came up in this discussion.

Related: #2473.

Reference issue

@codecov
Copy link

codecov bot commented May 16, 2023

Codecov Report

Patch coverage has no change and project coverage change: -0.18 ⚠️

Comparison is base (0199c58) 77.83% compared to head (10d5b01) 77.65%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2474      +/-   ##
==========================================
- Coverage   77.83%   77.65%   -0.18%     
==========================================
  Files          87       87              
  Lines        9319     9319              
==========================================
- Hits         7253     7237      -16     
- Misses       1639     1650      +11     
- Partials      427      432       +5     
Flag Coverage Δ
go 79.43% <ø> (-0.19%) ⬇️
wasm 70.15% <ø> (ø)

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

Impacted Files Coverage Δ
datachannel.go 87.27% <ø> (ø)
datachannel_js.go 42.19% <ø> (ø)

... and 4 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@Sean-Der
Copy link
Member

Thank you so much @WofWca!

Great fix, just working through the backlog.

This is in line with
* the docs for 'BufferedAmountLowThreshold' ("When the bufferedAmount
decreases from above this threshold to equal or below it")

* The actual code in 'pion/sctp':
https://github.com/pion/sctp/blob/d6446e3b0d0495d9974e68fec9b7fdb79c018ca1/stream.go#L422

* The Web WebRTC spec:
https://w3c.github.io/webrtc-pc/#event-datachannel-bufferedamountlow
@Sean-Der Sean-Der merged commit 66f0c40 into pion:master Sep 11, 2023
13 of 14 checks passed
tgragnato pushed a commit to tgragnato/snowflake that referenced this pull request Oct 12, 2023
The `dc.Send()` should increase the `bufferedAmount` value,
so there is no need to add the message length a second time.

Also replace GT with GE, for the case where
`BufferedAmountLowThreshold === maxBufferedAmount`

Currently the deadlock cannot happen because `maxBufferedAmount`
and `BufferedAmountLowThreshold` are too far apart, in fact
the former is 2x the latter.

See
- https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/-/merge_requests/144#note_2902956
- pion/webrtc#2473
- pion/webrtc#2474
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants