-
Notifications
You must be signed in to change notification settings - Fork 936
chore: Buffer remote candidates like local #77
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
Conversation
This was added for local candidates, and is required for remote to prevent a race where they are added before a negotiation is complete. I removed the mutex earlier, because it would cause a different race. I didn't realize the remote candidates wouldn't be buffered, but with this change they are!
Codecov Report
@@ Coverage Diff @@
## main #77 +/- ##
==========================================
+ Coverage 69.04% 71.93% +2.89%
==========================================
Files 84 88 +4
Lines 3256 3421 +165
Branches 55 55
==========================================
+ Hits 2248 2461 +213
+ Misses 825 752 -73
- Partials 183 208 +25
Continue to review full report at Codecov.
|
peer/conn.go
Outdated
c.localCandidateMutex.Lock() | ||
defer c.localCandidateMutex.Unlock() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was surprised we didn't need this, but saw it was brought back! I thought there might be cases where ICE candidates could come in, in parallel to negotiate
here.
This was added for local candidates, and is required for remote
to prevent a race where they are added before a negotiation is
complete.
I removed the mutex earlier, because it would cause a different race.
I didn't realize the remote candidates wouldn't be buffered,
but with this change they are!