p682 Fix GetStats webrtc call being in a wrong thread - #6083
Merged
Conversation
roxanneskelly
requested changes
Aug 3, 2026
roxanneskelly
left a comment
Contributor
There was a problem hiding this comment.
I noticed that the GetStats call into libwebrtc is being made on a viewer thread (the main thread.) Calls into libwebrtc should not be made on the main viewer thread, but should instead be made on the appropriate worker, signaling, or network webrtc thread. This might be what's going wrong here.
akleshchev
force-pushed
the
andreyk/viewer_p682
branch
from
August 4, 2026 08:21
afa9c04 to
2c735d7
Compare
Contributor
Author
|
GetStats internally marshals work to the signaling thread. Moving GetStats to signaling task deadlocks signaling thread. |
akleshchev
force-pushed
the
andreyk/viewer_p682
branch
2 times, most recently
from
August 4, 2026 15:18
78545e1 to
aa265ce
Compare
akleshchev
force-pushed
the
andreyk/viewer_p682
branch
from
August 4, 2026 16:40
aa265ce to
30ecc18
Compare
Contributor
Author
|
Dan says this resolves his problem with the usb headset. Bluetooth headset instead of freezing viewer breaks voice only. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Moved the blocking call into signaling thread. Fixed terminate to not wait indefinetely.
Sadly this doesn't fix the issue of GetStats blocking after an OS Sleep event, but avoids it. Since signaling thread is blocked, had to make terminate not wait indefinetely. But given that viewer is expected to only show 'lost connection, quit?' after a sleep event (we have a 'do not sleep' flag in develop) it is a good enough mitigation for now.