Closed Bug 1902850 Opened 3 months ago Closed 2 months ago

Creating many short lived WebRTC data channels fails

Categories

(Core :: WebRTC: Networking, defect)

Firefox 127
defect

Tracking

()

RESOLVED FIXED
129 Branch
Tracking Status
firefox129 --- fixed

People

(Reporter: alex, Assigned: bwc)

References

(Regressed 1 open bug)

Details

Attachments

(2 files)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36

Steps to reproduce:

See the runnable reproduction in this repo: https://github.com/achingbrain/webrtc-many-datachannels

The steps are:

  1. Have a WebRTC peer that just echoes and data received on a data channel back to the data channel
  2. Connect to the echoing peer
  3. Open a channel, wait for the channel to open, send a small amount of data, read a small amount of data, close the channel, wait for the channel to close
  4. Repeat no. 3

Actual results:

After a small number of iterations (2-3) the remote peer no longer receives new data channels but the sender thinks they've opened them.

No error event is emitted on the sender channel and the RTCPeerConnections at both ends remain in the "connected" state.

Expected results:

The remote peer should receive new channels and the sending peer should receive the data echoed back to it.

This works with Chrome as the sender and the echoer, it also works with Chrome as the sender and Firefox as the echoer, but it is broken with Firefox as the sender.

The Bugbug bot thinks this bug should belong to the 'Core::WebRTC' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → WebRTC
Product: Firefox → Core
Flags: needinfo?(docfaraday)
Component: WebRTC → WebRTC: Networking

Ok, I definitely am seeing some sort of race involving automatically chosen channel id reuse when channels are rapidly opened/used/closed. It looks like we're occasionally reusing a channel id too early and confusing the other side. Trying to figure out why that is, exactly.

Assignee: nobody → docfaraday
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(docfaraday)
Severity: -- → S2
Pushed by bcampen@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/4812f4312d4b
Test that repeated open/write/echo/close of datachannels works. r=jib
https://hg.mozilla.org/integration/autoland/rev/f4f6551a2943
Stop sending stream resets for streams we've already reset. r=ng
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/46987 for changes under testing/web-platform/tests
Regressions: 1906176
Status: NEW → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 129 Branch
Upstream PR merged by moz-wptsync-bot
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: