Repository navigation
fix: close a peer only once the control tasks queued before have run - #498
Merged
Merged
Conversation
A callback of WebRTC can queue a task behind a peer's teardown, such as a channel the remote side opened, which then disposes the native channel. The peer counted as closed before that task ran, so the runtime freed the factory and its threads under it, and the process crashed in RTCDataChannel.dispose. The peer now finishes closing in a control task queued after the connection closed.
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.
A WebRTC callback can queue a task behind a peer's teardown, such as a channel the remote side opened, and that task still disposes the native channel. The peer counted as closed before the task ran, so WebRtc.shutdown freed the factory and its threads under it; CI caught the process crashing with SIGBUS in RTCDataChannel.dispose on linux_arm64. The peer now finishes closing in a control task queued after the connection closed. RuntimeCloseTests.closeWaitsForTasksQueuedBehindTeardown fails without the fix.