Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Flaky connection with two local ex_webrtc clients #214

Unanswered
nieg675 asked this question in Q&A
Discussion options

Hi!

I was writing unit tests for some WebRTC functionality using ex_webrtc, and i noticed something a little strange. In my test, i am basically just connecting two ex_webrtc clients to each other and then waiting for 30s, to see if the connection remains successful. What i noticed is that 10-20% of the times it would fail. I would get the {:connection_state_change, :connected} on both clients so initially it would work, but then eventually i would get {:connection_state_change, :failed}, and a warning from ExICE: 12:07:53.601 [warning] <module=ExICE.Priv.ICEAgent function=change_connection_state/2 line=2576 > Requested ICE agent to move to the failed state but keepalives are not empty. Clearing keepalives.

I was really puzzled about this, so i took a look at the ex_webrtc unit tests to find an example (e.g. ExWebRTC.DataChannelTest), and here i saw that you always only pass the first ice candidate for each peer, and ignore the rest. I tried that, and my test was stable and the connection never failed anymore.

Is there anything that could explain this behavior? I am able to reproduce it on multiple machines. I can provide code and logs if needed.

You must be logged in to vote

Replies: 1 comment 1 reply

Comment options

Hi @nieg675,
thanks for the report!

Could you try to run all unit tests in ex_webrtc on your machine and see if that happens too?

ICE tries to select the best candidate pair so if you provide multiple candidates, the selected pair can change in time. It might be that we select different pairs on each end (due to some bug) and that's the reason why your peer connections disconnect.

Could you also provide versions of ex_webrtc and ex_ice, and dump debug logs from the both failing and successful tests? Note that these logs may include your public IP address so if you prefer to, you can send them on michal.sledz@swmansion.com or somehow sanitize them. Thanks a lot!

You must be logged in to vote
1 reply
Comment options

Thanks for your answer! I have sent you an email with the information. I forgot to give you my versions - I am running ex_webrtc 0.12.0 and ex_ice 0.12.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants

AltStyle によって変換されたページ (->オリジナル) /