From e376625a1365308ef823b7dbbb160dd3248352e0 Mon Sep 17 00:00:00 2001 From: Raja Subramanian Date: Thu, 14 Mar 2024 04:36:19 +0530 Subject: [PATCH] Do not need to flush stream allocator events. (#2577) --- pkg/rtc/dynacastmanager.go | 8 +++++--- pkg/sfu/streamallocator/streamallocator.go | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/pkg/rtc/dynacastmanager.go b/pkg/rtc/dynacastmanager.go index 0fed210ce..20b35cb81 100644 --- a/pkg/rtc/dynacastmanager.go +++ b/pkg/rtc/dynacastmanager.go @@ -91,7 +91,7 @@ func (d *DynacastManager) Restart() { } func (d *DynacastManager) Close() { - d.qualityNotifyOpQueue.Stop() + <-d.qualityNotifyOpQueue.Stop() d.lock.Lock() dqs := d.getDynacastQualitiesLocked() @@ -305,9 +305,11 @@ func (d *DynacastManager) enqueueSubscribedQualityChange() { } } - d.params.Logger.Debugw("subscribedMaxQualityChange", + d.params.Logger.Debugw( + "subscribedMaxQualityChange", "subscribedCodecs", subscribedCodecs, - "maxSubscribedQualities", maxSubscribedQualities) + "maxSubscribedQualities", maxSubscribedQualities, + ) d.qualityNotifyOpQueue.Enqueue(func() { d.onSubscribedMaxQualityChange(subscribedCodecs, maxSubscribedQualities) }) diff --git a/pkg/sfu/streamallocator/streamallocator.go b/pkg/sfu/streamallocator/streamallocator.go index 6370692b0..beda5f10a 100644 --- a/pkg/sfu/streamallocator/streamallocator.go +++ b/pkg/sfu/streamallocator/streamallocator.go @@ -180,7 +180,7 @@ func NewStreamAllocator(params StreamAllocatorParams) *StreamAllocator { }), rateMonitor: NewRateMonitor(), videoTracks: make(map[livekit.TrackID]*Track), - eventsQueue: utils.NewOpsQueue("stream-allocator", 64, true), + eventsQueue: utils.NewOpsQueue("stream-allocator", 64, false), } s.probeController = NewProbeController(ProbeControllerParams{