Remove published remote tracks in RoomSession::close() - #1382
Open
raparanjpe wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Devin Review found 1 potential issue.
1 flag not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)
Comment on lines
+1176
to
+1178
| for (_, participant) in self.remote_participants.read().clone() { | ||
| for (sid, _) in participant.track_publications() { | ||
| participant.unpublish_track(&sid); |
Contributor
There was a problem hiding this comment.
🟡 Concurrent updates survive room closure
If an update arrives while close awaits engine shutdown, the earlier snapshot misses its participant or track. The closed room retains that publication.
Prompt for agents
RoomSession::close cleans remote participant publications while room_task can still process EngineEvent::ParticipantUpdate and EngineEvent::MediaTrack. Because both the participant map and each publication map are snapshots, updates handled after those snapshots can add publications that survive closure. Reorder teardown so no room event can mutate remote participants before the final remote-publication cleanup, while preserving delivery of TrackUnsubscribed and TrackUnpublished events and the existing local-track shutdown requirements. Add a concurrency-focused test that queues a participant or track update during close and verifies every retained RemoteParticipant has no publications when close returns.
Was this helpful? React with 👍 or 👎 to provide feedback.
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.
Closes #1378
The idea here is to follow a similar procedure to
fn handle_participant_disconnectwhere we handle participant disconnects, but we should also do so when closing out a room.