Add some more logging around migration. (#4426)
Some e2e is failing due to subscriptions happening late and the expected order of m-lines is different. Not a hard failure, but logging more to make seeing this easie.
This commit is contained in:
+21
-1
@@ -191,6 +191,19 @@ type trackDescription struct {
|
|||||||
sender *webrtc.RTPSender
|
sender *webrtc.RTPSender
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (t trackDescription) MarshalLogObject(e zapcore.ObjectEncoder) error {
|
||||||
|
e.AddString("mid", t.mid)
|
||||||
|
if t.sender != nil {
|
||||||
|
track := t.sender.Track()
|
||||||
|
if track != nil {
|
||||||
|
e.AddString("trackID", track.ID())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// -------------------------------------------------------------------
|
||||||
|
|
||||||
// PCTransport is a wrapper around PeerConnection, with some helper methods
|
// PCTransport is a wrapper around PeerConnection, with some helper methods
|
||||||
type PCTransport struct {
|
type PCTransport struct {
|
||||||
params TransportParams
|
params TransportParams
|
||||||
@@ -2159,6 +2172,7 @@ func (t *PCTransport) initPCWithPreviousAnswer(previousAnswer webrtc.SessionDesc
|
|||||||
}
|
}
|
||||||
mid := lksdp.GetMidValue(m)
|
mid := lksdp.GetMidValue(m)
|
||||||
if mid == "" {
|
if mid == "" {
|
||||||
|
t.params.Logger.Warnw("cannot set up peer connection with previous answer, mid not found", nil, "senders", slices.Collect(maps.Keys(senders)))
|
||||||
return senders, ErrMidNotFound
|
return senders, ErrMidNotFound
|
||||||
}
|
}
|
||||||
tr.SetMid(mid)
|
tr.SetMid(mid)
|
||||||
@@ -2170,6 +2184,7 @@ func (t *PCTransport) initPCWithPreviousAnswer(previousAnswer webrtc.SessionDesc
|
|||||||
// set transceiver to inactive
|
// set transceiver to inactive
|
||||||
tr.SetSender(sender, nil)
|
tr.SetSender(sender, nil)
|
||||||
}
|
}
|
||||||
|
t.params.Logger.Debugw("set up peer connection with previous answer", "senders", slices.Collect(maps.Keys(senders)))
|
||||||
return senders, nil
|
return senders, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2205,7 +2220,7 @@ func (t *PCTransport) SetPreviousSdp(localDescription, remoteDescription *webrtc
|
|||||||
}
|
}
|
||||||
|
|
||||||
if localDescription != nil && parseMids {
|
if localDescription != nil && parseMids {
|
||||||
// in migration case, can't reuse transceiver before negotiating excepted tracks
|
// in migration case, can't reuse transceiver before negotiating expected tracks
|
||||||
// that were subscribed at previous node
|
// that were subscribed at previous node
|
||||||
t.canReuseTransceiver = false
|
t.canReuseTransceiver = false
|
||||||
if err := t.parseTrackMid(*localDescription, senders); err != nil {
|
if err := t.parseTrackMid(*localDescription, senders); err != nil {
|
||||||
@@ -2249,6 +2264,9 @@ func (t *PCTransport) parseTrackMid(sd webrtc.SessionDescription, senders map[st
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if len(t.previousTrackDescription) != 0 {
|
||||||
|
t.params.Logger.Debugw("previous track description", t.previousTrackDescription)
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2689,6 +2707,7 @@ func (t *PCTransport) setRemoteDescription(sd webrtc.SessionDescription) error {
|
|||||||
if !t.canReuseTransceiver {
|
if !t.canReuseTransceiver {
|
||||||
t.canReuseTransceiver = true
|
t.canReuseTransceiver = true
|
||||||
t.previousTrackDescription = make(map[string]*trackDescription)
|
t.previousTrackDescription = make(map[string]*trackDescription)
|
||||||
|
t.params.Logger.Debugw("enabling transceiver reuse")
|
||||||
}
|
}
|
||||||
t.lock.Unlock()
|
t.lock.Unlock()
|
||||||
}
|
}
|
||||||
@@ -2771,6 +2790,7 @@ func (t *PCTransport) createAndSendAnswer() error {
|
|||||||
if !t.canReuseTransceiver {
|
if !t.canReuseTransceiver {
|
||||||
t.canReuseTransceiver = true
|
t.canReuseTransceiver = true
|
||||||
t.previousTrackDescription = make(map[string]*trackDescription)
|
t.previousTrackDescription = make(map[string]*trackDescription)
|
||||||
|
t.params.Logger.Debugw("enabling transceiver reuse")
|
||||||
}
|
}
|
||||||
t.lock.Unlock()
|
t.lock.Unlock()
|
||||||
|
|
||||||
|
|||||||
@@ -90,23 +90,23 @@ func InitializeServer(conf *config.Config, currentNode routing.LocalNode) (*Live
|
|||||||
}
|
}
|
||||||
rtcEgressLauncher := NewEgressLauncher(egressClient, ioInfoService, objectStore)
|
rtcEgressLauncher := NewEgressLauncher(egressClient, ioInfoService, objectStore)
|
||||||
topicFormatter := rpc.NewTopicFormatter()
|
topicFormatter := rpc.NewTopicFormatter()
|
||||||
v, err := rpc.NewTypedRoomClient(clientParams)
|
roomClient, err := rpc.NewTypedRoomClient(clientParams)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
v2, err := rpc.NewTypedParticipantClient(clientParams)
|
participantClient, err := rpc.NewTypedParticipantClient(clientParams)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
roomService, err := NewRoomService(limitConfig, apiConfig, router, roomAllocator, objectStore, rtcEgressLauncher, topicFormatter, v, v2)
|
roomService, err := NewRoomService(limitConfig, apiConfig, router, roomAllocator, objectStore, rtcEgressLauncher, topicFormatter, roomClient, participantClient)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
v3, err := rpc.NewTypedAgentDispatchInternalClient(clientParams)
|
agentDispatchInternalClient, err := rpc.NewTypedAgentDispatchInternalClient(clientParams)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
agentDispatchService := NewAgentDispatchService(v3, topicFormatter, roomAllocator, router)
|
agentDispatchService := NewAgentDispatchService(agentDispatchInternalClient, topicFormatter, roomAllocator, router)
|
||||||
egressService := NewEgressService(egressClient, rtcEgressLauncher, ioInfoService, roomService)
|
egressService := NewEgressService(egressClient, rtcEgressLauncher, ioInfoService, roomService)
|
||||||
ingressConfig := getIngressConfig(conf)
|
ingressConfig := getIngressConfig(conf)
|
||||||
ingressClient, err := rpc.NewIngressClient(clientParams)
|
ingressClient, err := rpc.NewIngressClient(clientParams)
|
||||||
@@ -121,11 +121,11 @@ func InitializeServer(conf *config.Config, currentNode routing.LocalNode) (*Live
|
|||||||
}
|
}
|
||||||
sipService := NewSIPService(sipConfig, nodeID, messageBus, sipClient, sipStore, roomService, telemetryService)
|
sipService := NewSIPService(sipConfig, nodeID, messageBus, sipClient, sipStore, roomService, telemetryService)
|
||||||
rtcService := NewRTCService(conf, roomAllocator, router, telemetryService)
|
rtcService := NewRTCService(conf, roomAllocator, router, telemetryService)
|
||||||
v4, err := rpc.NewTypedWHIPParticipantClient(clientParams)
|
whipParticipantClient, err := rpc.NewTypedWHIPParticipantClient(clientParams)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
serviceWHIPService, err := NewWHIPService(conf, router, roomAllocator, clientParams, topicFormatter, v4)
|
serviceWHIPService, err := NewWHIPService(conf, router, roomAllocator, clientParams, topicFormatter, whipParticipantClient)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user