[WebRTC] Unable to Restart ICE connection more than once |
|||||||
Issue descriptionChrome Version: 65.0.3325.51 OS: Windows 10 What steps will reproduce the problem? (1) Go to https://webrtc.github.io/samples/src/content/peerconnection/restart-ice/ (2) Click on Start (3) Click on Call (4) Click on Restart ICE (5) Click on Restart ICE again if Its enabled (6) Click on Restart ICE again if Its enabled What is the expected result? It should be possible to restart ICE connection as many times as we wanted What happens instead? Restart ICE button gets disabled after one or two times and main.js:280 returns null value Reproducibility : 100% in Windows 10 Note: Works in Chromebook, Macbook
,
Feb 12 2018
Reproduced in Chromebook too (after 5 times restarting ICE, the button gets disabled and can't do it any more). Chromebook Daisy, 10323.21.0 / 65.0.3325.56
,
Feb 12 2018
,
Mar 21 2018
,
Mar 22 2018
hbos@: Can you take a look?
,
Mar 23 2018
,
Mar 31 2018
I don't know if this is relevant to this issue, but I also see problems with createOffer(..., {iceRestart: true})
With a STUN-only config, initial connect and ice-restart work fine.
With a TURN config and iceTransportPolicy = 'relay', initial connect is ok, but ice-restarts from peer 1 do not succeed when peer 2 is restarted.
,
Apr 3 2018
+deadbeef, hta: Do you know anything about this?
,
Apr 3 2018
re #7: Does this concern a test case where both ends are restarted at the same time, or is it one restart, then another restart? I don't know if we test ICE restart collision very well.
,
Apr 3 2018
I think this is just an issue with the sample page. It enables the "Restart ICE" button when the state transitions from "completed" to "connected". But if you click the button quickly enough, you can trigger a restart while still in the "connected" state (from the last restart), and thus that transition won't occur. Here's an issue filed against the webrtc/samples repository: https://github.com/webrtc/samples/issues/1036
,
Apr 4 2018
Hi again,
Maybe I should open another issue for this?
I will first explain my findings before trying to come up with a test case to reproduce this.
Background:
A = client (regular chrome on ubuntu 16.04.3 LTS)
B = client (electron 1.7.13/ chromium on RPI3)
A and B both tested on same and different networks.
Issue:
A connects to B using signaling server + TURN (ok)
A opens datachannel, B gets ondatachannel event (ok)
---- At this point, the connection works for multiple hours ----
B is restarted, so back to initial internal state.
A fires 'oniceconnectionstatechange disconnected' (ok)
A fires 'oniceconnectionstatechange failed' (ok)
A does createOffer({iceRestart: true}) (manually)
B gets offer (with datachannel & generation 1) (ok)
B does not fire ondatachannel (not sure why? Is this due to the 'reboot' of B?)
now here is the confusing part:
A fires 'oniceconnectionstatechange connected' (ok)
A has rtcDataChannel.readyState == 'open' (?? B did not fire ondatachannel)
of course at this point, communication over rtcDataChannel does not work, but rtcDataChannel.send() does not raise any errors.
Before I dig further: is the iceRestart sequence allowed and correct, either during 'disconnected' or 'failed'?
Thanks!
,
Apr 4 2018
When you say "B is restarted", do you mean an ICE restart, or a whole new PeerConnection? If it's the latter, then I think the SCTP association would need to be re-established, and a new data channel would need to be created. "ondatachannel" doesn't fire for B because A doesn't send another "open" message, because it was already sent successfully, and as far as A knows, it's talking to the same endpoint as before which still knows about the data channel. In theory, you could establish a new SCTP association by changing the "a=sctp-port", but that's not implemented: https://cs.chromium.org/chromium/src/third_party/webrtc/media/sctp/sctptransport.cc?l=449&rcl=8058fbbd6bc09dd64b87a479d4028a0d8a2fed5b So, I think the only workaround available right now would be modifying the SDP to reject the SCTP m= section (using a port of 0 on the m= line; "m=application 0"), then doing another offer/answer to re-negotiate it.
,
Apr 4 2018
B is restarted = new PeerConnection(), as in a page refresh indeed. However, there is no straightforward way for the user of the rtcDataChannel at 'A' that this has ever happened: 1. The ICE happily reconnects at A and B. 2. B ignores the 'old dataChannel' request and A keeps sending over the dataChannel, no errors. I think this should be reflected in the readyState. I'll check if the 'old dataChannel' reconnects in case of a temporary network loss, and come back with the results here. At this moment, I let 'A' create a 'new PeerConnection()' at any disconnect and this works fine, but ICE restarts are faster... |
|||||||
►
Sign in to add a comment |
|||||||
Comment 1 by rantonysamy@chromium.org
, Feb 12 201872.8 KB
72.8 KB View Download