Loop to print handle counts#1079
Draft
MaxHeimbrock wants to merge 1 commit into
Draft
Conversation
Contributor
No changeset foundThis PR modifies the following packages but doesn't include a changeset: Directly changed:
Click here to create a changeset The link pre-populates a changeset file with If this change doesn't require a version bump, add the |
1 task
MaxHeimbrock
added a commit
that referenced
this pull request
May 15, 2026
## Summary Found while counting handles during Unity sessions via #1079 ### Background The `forward_event` handler for `RoomEvent::LocalTrackPublished` was allocating a fresh `FfiPublication`, calling `FfiServer::store_handle`, and then sending the proto event without the handle id. Because `proto::LocalTrackPublished` only carries `track_sid`, the foreign-language client never received the id and had no way to call `drop_handle` on it. Each local `publish_track` call therefore leaked one publication entry in the FFI handle table for the lifetime of the process. The publication is already wrapped and handed to the client via the `PublishTrackCallback` path. The `LocalTrackPublished` event is a notification that fires after that callback to let the client run any post-publish bookkeeping; it does not need its own handle. Drop the redundant allocation entirely. Surfaced while investigating untracked memory growth in the Unity SDK, where the FFI handle table held two publication entries per local track across a session and only one of them could be dropped on disconnect.
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.
Info
Just a loop that prints the handles stored in the FFI Client to debug leaks in our cleanup.