remote_access: Always run Room::close to completion - #1453
Open
gasmith wants to merge 4 commits into
Open
Conversation
### Changelog - Fixed an issue where a gateway may stay connected to a room indefinitely after the last viewer has disconnected. ### Docs None ### Links Fixes: DB-1714 ### Description LiveKit has an upstream bug where `Room::close` can hang indefinitely. For that reason, the SDK has a timeout. However, when the timeout is reached, we drop the `Room`. That's the wrong thing to do, because the `Room` doesn't impl `Drop`, and so we end up leaking our connection, and staying in the room forever. This change runs `Room::close` in a separate task, to ensure that it runs to completion. Our loop waits on that task for 20s before giving up, and allowing it to proceed in the background. This threshold seesm slightly more realistic than 5s, based on Claude's research into the livekit crate.
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.
Changelog
indefinitely after the last viewer has disconnected.
Docs
None
Links
Fixes: DB-1714
Description
LiveKit has an upstream bug where
Room::closecan hang indefinitely.For that reason, the SDK has a timeout. However, when the timeout is
reached, we drop the
Room. That's the wrong thing to do, because theRoomdoesn't implDrop, and so we end up leaking our connection, andstaying in the room forever.
This change runs
Room::closein a separate task, to ensure that itruns to completion. Our loop waits on that task for 20s before giving
up, and allowing it to proceed in the background. This threshold seems
slightly more realistic than 5s, based on Claude's research into the
livekit crate.