Skip to content

Fix deadlock in data-channels-flow-control example. #679

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

Merged
merged 1 commit into from
May 27, 2025

Conversation

recap
Copy link
Contributor

@recap recap commented May 27, 2025

While investigating #101 I realized that a deadlock is occurring when using data-channels-flow-control example. This has something to do with the requestor and responder using the same tokio event loop. When I split the data-channels-flow-control into two processes (like in the e.g. offer-answer) the deadlock did not show up. After more investigation it seems to deadlock occurs after the write_loop is woken up and association_internal.lock() is waited on. Yielding before acquiring the lock allows other tasks to make progress which seems to prevent the writer from blocking. I tested it on x86_64 and Darwin.

@rainliu rainliu merged commit 86a2b00 into webrtc-rs:master May 27, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants