Skip to content

Not all relayed tracks received due to race condition #673

@fffilimonov

Description

@fffilimonov

Your environment.

  • Version: daf197a
  • Client: daf197a
  • Environement: macOS
  • Are you using a TURN server? no

What did you do?

Trying to relay tracks between 2 ion-sfu

What did you expect?

Tracks relayed

What happened?

I do:

Peer.Publisher().Relay(...)
session.AddRelayPeer(peerID string, signalData []byte) ([]byte, error)

sometimes first relayed track from SFU1 not received on SFU2

I found the root cause:
SFU1 call createRelayTrack after OnOpen event for dataChannel created between SFU1 and SFU2
it leads to sending message via dataChannel to SFU2 with ion_relay_request for this track
sometimes SFU2 receives message ion_relay_request from dataChannel before OnOpen fired on SFU2 and NewRelayPeer called
it leads to calling receive with no onTrack handlers set

As I understand OnOpen for dataChannel on SFU1 side and OnOpen on SFU2 not synchronized.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions