Skip to content

Update (current|pending)RemoteDescription SDP after addIceCandidate#3413

Draft
fippo wants to merge 1 commit intomainfrom
addicecandidate-update-remotedescription
Draft

Update (current|pending)RemoteDescription SDP after addIceCandidate#3413
fippo wants to merge 1 commit intomainfrom
addicecandidate-update-remotedescription

Conversation

@fippo
Copy link
Copy Markdown
Contributor

@fippo fippo commented Apr 17, 2026

@fippo fippo force-pushed the addicecandidate-update-remotedescription branch from a992540 to 85ba51d Compare April 17, 2026 17:33
@fippo
Copy link
Copy Markdown
Contributor Author

fippo commented Apr 17, 2026

@JoTurk 🤔 any idea what causes the test failures? They are either totally uncorrelated or I need to move the test to the go layer...

@JoTurk
Copy link
Copy Markdown
Member

JoTurk commented Apr 17, 2026

@fippo there is a race in attribute.

Comment thread peerconnection.go
Comment on lines +2128 to +2135
if err := pc.pendingRemoteDescription.UpdateWithCandidate(candidate); err != nil {
return err
}
}
if pc.currentRemoteDescription != nil {
if err := pc.currentRemoteDescription.UpdateWithCandidate(candidate); err != nil {
return err
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This updates the candidates' attributes while startRTP is reading them. which cases the test to fail with race detected.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

but why does startRtp look at the candidates in the SDP instead of getting them from the ICE agent? Also why does anything RTP not consider ICE a virtual socket? 🤔

Copy link
Copy Markdown
Member

@JoTurk JoTurk May 5, 2026

Choose a reason for hiding this comment

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

Sorry i missed this so this is partly done for historic reasons. during early calls (we'll change this with ice v5, where we'll move more ownership to ice), also check the mux in this repo, especially at the close handling, currently we have multiple semi ownership for sockets.
There is a plan to move most of the ownership and write to one place, also so we can do low level socket optimizations and similar stuff.

@fippo fippo marked this pull request as draft April 22, 2026 10:08
@fippo fippo force-pushed the addicecandidate-update-remotedescription branch from 85ba51d to 5691236 Compare May 5, 2026 11:44
@codecov
Copy link
Copy Markdown

codecov Bot commented May 5, 2026

Codecov Report

❌ Patch coverage is 73.68421% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.47%. Comparing base (f857501) to head (5691236).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
peerconnection.go 62.50% 3 Missing and 3 partials ⚠️
sessiondescription.go 81.81% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3413      +/-   ##
==========================================
- Coverage   85.52%   85.47%   -0.06%     
==========================================
  Files          81       81              
  Lines        9819     9854      +35     
==========================================
+ Hits         8398     8423      +25     
- Misses       1002     1006       +4     
- Partials      419      425       +6     
Flag Coverage Δ
go 85.47% <73.68%> (-0.06%) ⬇️

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

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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