Skip to content

p682 Fix GetStats webrtc call being in a wrong thread - #6083

Merged
akleshchev merged 2 commits into
release/26.3from
andreyk/viewer_p682
Aug 6, 2026
Merged

p682 Fix GetStats webrtc call being in a wrong thread#6083
akleshchev merged 2 commits into
release/26.3from
andreyk/viewer_p682

Conversation

@akleshchev

@akleshchev akleshchev commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

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.

@roxanneskelly roxanneskelly left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
akleshchev force-pushed the andreyk/viewer_p682 branch from afa9c04 to 2c735d7 Compare August 4, 2026 08:21
@akleshchev

akleshchev commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

GetStats internally marshals work to the signaling thread. Moving GetStats to signaling task deadlocks signaling thread.

@akleshchev
akleshchev force-pushed the andreyk/viewer_p682 branch 2 times, most recently from 78545e1 to aa265ce Compare August 4, 2026 15:18
@akleshchev akleshchev changed the title Andreyk/viewer p682 p682 Fix GetStats webrtc call being in a wrong thread Aug 4, 2026
@akleshchev
akleshchev force-pushed the andreyk/viewer_p682 branch from aa265ce to 30ecc18 Compare August 4, 2026 16:40
@akleshchev

Copy link
Copy Markdown
Contributor Author

Dan says this resolves his problem with the usb headset. Bluetooth headset instead of freezing viewer breaks voice only.

@roxanneskelly roxanneskelly left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@akleshchev
akleshchev merged commit 0686467 into release/26.3 Aug 6, 2026
12 checks passed
@akleshchev
akleshchev deleted the andreyk/viewer_p682 branch August 6, 2026 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants