mirror of
https://github.com/livekit/livekit.git
synced 2026-07-02 13:32:19 +00:00
Close both peer connections to aid migration. (#4382)
* Close both peer connections to aid migration. In single peer connection case, that would close publisher peer connection. @cnderrauber I don't remember why we only closed subscriber peer connection. I am thinking it is okay to close both (or the publisher peer connection in single peer connection mode). Please let me know if I am missing something. * log change only
This commit is contained in:
@@ -687,7 +687,7 @@ func (t *MediaTrackReceiver) SetLayerSsrcsForRid(mimeType mime.MimeType, rid str
|
||||
matchingLayer.RepairSsrc = repairSSRC
|
||||
}
|
||||
}
|
||||
if ssrcFound {
|
||||
if ssrcFound && (matchingLayer.Ssrc != ssrc || matchingLayer.RepairSsrc != repairSSRC) {
|
||||
t.params.Logger.Warnw(
|
||||
"not overriding ssrc", nil,
|
||||
"rid", rid,
|
||||
@@ -695,7 +695,7 @@ func (t *MediaTrackReceiver) SetLayerSsrcsForRid(mimeType mime.MimeType, rid str
|
||||
"existingSSRC", matchingLayer.Ssrc,
|
||||
"repairSSRC", repairSSRC,
|
||||
"existingRepairSSRC", matchingLayer.RepairSsrc,
|
||||
"trackInfo", trackInfo,
|
||||
"trackInfo", logger.Proto(trackInfo),
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -1513,7 +1513,7 @@ func (p *ParticipantImpl) setupMigrationTimerLocked() {
|
||||
if p.IsClosed() || p.IsDisconnected() {
|
||||
return
|
||||
}
|
||||
p.subLogger.Debugw("closing subscriber peer connection to aid migration")
|
||||
p.subLogger.Debugw("closing peer connection(s) to aid migration")
|
||||
|
||||
//
|
||||
// Close all down tracks before closing subscriber peer connection.
|
||||
@@ -1523,7 +1523,7 @@ func (p *ParticipantImpl) setupMigrationTimerLocked() {
|
||||
//
|
||||
p.SubscriptionManager.Close(true)
|
||||
|
||||
p.TransportManager.SubscriberClose()
|
||||
p.TransportManager.Close()
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -211,20 +211,6 @@ func (t *TransportManager) Close() {
|
||||
}
|
||||
}
|
||||
|
||||
func (t *TransportManager) SubscriberClose() {
|
||||
var subscriberClosed atomic.Bool
|
||||
time.AfterFunc(time.Minute, func() { // CLOSE-DEBUG-CLEANUP
|
||||
if !subscriberClosed.Load() {
|
||||
t.params.Logger.Infow(
|
||||
"transport maanager subscriber close timeout",
|
||||
"subscriberClosed", subscriberClosed.Load(),
|
||||
)
|
||||
}
|
||||
})
|
||||
t.subscriber.Close()
|
||||
subscriberClosed.Store(true)
|
||||
}
|
||||
|
||||
func (t *TransportManager) HasPublisherEverConnected() bool {
|
||||
return t.publisher.HasEverConnected()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user