-
Notifications
You must be signed in to change notification settings - Fork 277
Deadlocks when using Dispose/Close PeerConnection on UI Thread #343
Comments
I am having a similar issue with not being able to close a call and try to start a new one using the master branch. When trying to start a new call I am getting an index out of bounds exception PeerConnection.StartConnection(), the Debug.Assert(transceivers[index++] == tr); is throwing the exception. |
@djee-ms is there any possibility the transceivers are not getting cleaned up properly after a close() and then trying to start a new connection? |
@astaikos316 > Yes it's likely, thanks for opening #375. |
@AtosNicoS I couldn't reproduce this on latest master (I tried adding a Close() call on the UI thread to the test UWP app). Can you verify if this still happens to you, and in that case provide a code sample? |
@fibann I am using 1.0.3 as this is the current stable. I do not have the time resources to test the current master, as it has breaking API changes it seems. If version 2.0 comes out, we will integrate the upgrade and I am able to test. However the issue from @astaikos316 seems to exists as well? |
@AtosNicoS preview packages for 2.0 are available at https://github.com/microsoft/MixedReality-WebRTC/releases/tag/v2.0.0-preview.1, we hope to finalize the release in the next few days. There are no further work/fixes planned to 1.0, so our recommendation is switching to 2.0 as soon as it is convenient. #375 has been resolved (also, it probably doesn't affect 1.0). |
From what I've noticed, that deadlock issue is still there. But I do not have a minimal example to test, sadly. |
@AtosNicoS I have been double-checking the original post:
From this line it sounds like it's app code (in an event callback) that wants to switch to the main thread, rather than MR-WebRTC internal code. Can you confirm? If this is the case, then this is not a bug, but an unavoidable side effect of WebRTC serializing all API calls and callbacks on its signaling thread. So you can't call any WebRTC API if you are blocking the signaling thread by e.g. waiting in an event callback. |
Describe the bug
I had some deadlock issues with the library when trying to dispose the PeerConnection.
To Reproduce
Steps to reproduce the behavior:
Environment
Please fill the information for each peer if different
Additional context
The official example does not show how to dispose/close a call. How can we ensure to not dispose the PeerConnection on the ui thread without using Task.Run and using an async dispose? Async Dispose is something I want to avoid.
I can workaround this issue by disabling the frame updates and stopping the remote video before calling
Close()
:The text was updated successfully, but these errors were encountered: