Skip to content

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

Merged
merged 25 commits into from
Jan 27, 2022
Merged

chore: Buffer remote candidates like local #77

merged 25 commits into from
Jan 27, 2022

Conversation

kylecarbs
Copy link
Member

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!

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!
@kylecarbs kylecarbs self-assigned this Jan 27, 2022
@codecov
Copy link

codecov bot commented Jan 27, 2022

Codecov Report

Merging #77 (5021b95) into main (9329a50) will increase coverage by 2.89%.
The diff coverage is 94.11%.

Impacted file tree graph

@@            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     
Flag Coverage Δ
unittest-go-macos-latest 67.40% <94.11%> (+0.06%) ⬆️
unittest-go-ubuntu-latest 69.83% <94.11%> (?)
unittest-go-windows-latest 67.40% <94.11%> (?)
unittest-js 78.30% <ø> (ø)
Impacted Files Coverage Δ
peer/conn.go 76.20% <93.75%> (+1.99%) ⬆️
peer/channel.go 87.19% <100.00%> (+0.69%) ⬆️
peerbroker/listen.go 80.46% <0.00%> (-2.35%) ⬇️
provisioner/terraform/serve.go 66.66% <0.00%> (ø)
database/postgres/postgres.go 66.66% <0.00%> (ø)
provisioner/terraform/parse.go 70.73% <0.00%> (ø)
provisioner/terraform/provision.go 63.26% <0.00%> (ø)
coderd/coderdtest/coderdtest.go 100.00% <0.00%> (+22.64%) ⬆️
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9329a50...5021b95. Read the comment docs.

peer/conn.go Outdated
Comment on lines 309 to 310
c.localCandidateMutex.Lock()
defer c.localCandidateMutex.Unlock()
Copy link
Contributor

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.

@kylecarbs kylecarbs self-assigned this Jan 27, 2022
@bryphe-coder
Copy link
Contributor

Woah so nice to see the green! 🎉 🥳

image

@kylecarbs kylecarbs merged commit 30dae97 into main Jan 27, 2022
@kylecarbs kylecarbs deleted the peerrace2 branch January 27, 2022 15:14
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.

3 participants