-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Infinite loop in CreateOffer #1656
Comments
The root issue was that my code was erroneously attempting to negotiate an empty set of video codecs, which resulted in the empty media track section in the SDP cited above. Note that the strange SDP was generated by Pion. I am not sure whether this is the correct behaviour in this case (impossible to satisfy constraints) — other conceivable behaviours would be to fail at My suggestions:
|
If the local description keeps getting changed, or in case of a but in Pion, CreateOffer never terminates, which could cause client software to hang. Set an arbitrary bound on the number of iterations. Relates to #1656
Fixed by 1640767 |
Webrtc is at cddf631.
I've got a reproducible hang in CreateOffer, where
hasLocalDescriptionChanged
persistently returns true although nothing is changing. Adding a loop to doprintln(t.Mid())
yields (0, 1). Addingprintln(desc.SDP)
yields:Yes, I'm positive that it ends just after the
m=
line.The sequence of events is as follows. The server (Pion) does
pc.AddTrack(t1)
, wheret1
is aTrackLocalStaticRTP
. It then performsCreateOffer
, which works fine,SetLocalDescription
and sends the local description over the signalling channel to the client (browser). The server then performspc.AddTrack(t2)
, and notices that negotiation is still in progress, so it waits for the (now obsolete) answer from the client, and doesSetRemoteDescription
. Now the PC is in a stable signalling state once again, so the server performsCreateOffer
again, which hangs.Just to be clear: the call to
pc.AddTrack(t2)
happens beforeSetRemoteDescription
, and therefore before the second call toCreateOffer
. There are no concurrency issues here, justAddTrack
which races withSetRemoteDescription
of an obsolete answer.The text was updated successfully, but these errors were encountered: