Proposed fix for tokio runtime missing when called from Unity .NET GC#1016
Open
MaxHeimbrock wants to merge 3 commits intomainfrom
Open
Proposed fix for tokio runtime missing when called from Unity .NET GC#1016MaxHeimbrock wants to merge 3 commits intomainfrom
MaxHeimbrock wants to merge 3 commits intomainfrom
Conversation
Contributor
ChangesetThe following package versions will be affected by this PR:
|
8d72c50 to
f6a2122
Compare
Reproduces the crash seen in the Unity SDK when a StreamWriter's FfiHandle is released by the .NET GC finalizer thread (CLT-2773). The finalizer thread has no Tokio runtime in TLS, so the unconditional tokio::spawn in RawStream::drop panics with "there is no reactor running". Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
23f4fe7 to
03e5992
Compare
xianshijing-lk
approved these changes
Apr 17, 2026
Contributor
|
lgtm |
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.
First commit introduces a new test that repros the crash I see in Unity and tests fails:
https://github.com/livekit/rust-sdks/actions/runs/24567408053
With second commit the bug is fixed and tests are green again, as seen in pipeline now.