Improved robustness of subscription stack (#1382)

UpdateSubscription had a shortcoming where when it couldn't find the
participant, it ignored the request.

This PR further removes the reliance of current publisher state from
subscribers.
- SubscribeToTrack only takes in a trackID
- Introduced RoomTrackManager to maintain all published tracks to a room
- Added TrackUnpublished event to clearly indicate when a track has been removed
- SubscribeRequested event no longer include information about the publisher
This commit is contained in:
David Zhao
2023-02-06 18:08:26 -08:00
committed by GitHub
parent aaba402ada
commit 2851a8ac98
14 changed files with 365 additions and 205 deletions
-2
View File
@@ -245,14 +245,12 @@ func (t *telemetryService) TrackSubscribeRequested(
ctx context.Context,
participantID livekit.ParticipantID,
track *livekit.TrackInfo,
publisher *livekit.ParticipantInfo,
) {
t.enqueue(func() {
prometheus.RecordTrackSubscribeAttempt()
room := t.getRoomDetails(participantID)
ev := newTrackEvent(livekit.AnalyticsEventType_TRACK_SUBSCRIBE_REQUESTED, room, participantID, track)
ev.Publisher = publisher
t.SendEvent(ctx, ev)
})
}