Swap result sink atomically rather than closing and setting. (#4216)

To prevent WriteMessage after Close potentially.
This commit is contained in:
Raja Subramanian
2026-01-03 03:17:58 +05:30
committed by GitHub
parent 46651c1978
commit 335f4c33fb
10 changed files with 80 additions and 66 deletions
+1 -1
View File
@@ -392,7 +392,7 @@ func NewParticipant(params ParticipantParams) (*ParticipantImpl, error) {
p.state.Store(livekit.ParticipantInfo_JOINING)
p.grants.Store(params.Grants.Clone())
p.SetResponseSink(params.Sink)
p.SwapResponseSink(params.Sink, types.SignallingCloseReasonUnknown)
p.setupEnabledCodecs(params.PublishEnabledCodecs, params.SubscribeEnabledCodecs, params.ClientConf.GetDisabledCodecs())
if p.supervisor != nil {