Skip to content

Assert that OnICEConnectionStateChange doesn't incorrectly report disconnected #1002

@gqgs

Description

@gqgs

Your environment.

  • Version: 20f2d18
  • Browser: Chrome 78.0.3904.97
  • Other Information - running Pion in a remote docker container.

What did you do?

Established a connection with a remote server.

What did you expect?

The peer to stay connected with the server until it decides to close the connection.

What happened?

On Chrome, the connection is being closed (going to a disconnected state) 30 seconds after being established.

After some debugging it seems this method is responsible for closing the connection:
https://github.com/pion/ice/blob/37bfc6f4d997e5a6d9e836fd9607b9c9aefbc2b6/agent.go#L769

Some lines that appear to be relevant from the debug log:

ice INFO: 2020/02/04 13:25:33 Setting new connection state: Checking
ice DEBUG: 13:25:33.768620 agent.go:1143: adding a new peer-reflexive candidate: $remote:43116
ice TRACE: 13:25:33.816489 agent.go:639: Set selected candidate pair: prio 7998392936314175487 (local, prio 2130706431) host $local:39823 <-> prflx $remote:43116 related :0 (remote, prio 1862270975)
ice INFO: 2020/02/04 13:25:33 Setting new connection state: Connected
ice DEBUG: 13:25:34.015233 agent.go:1143: adding a new peer-reflexive candidate: $remote:1619 
ice DEBUG: 13:25:34.253331 agent.go:1143: adding a new peer-reflexive candidate: $remote:48095
ice DEBUG: 13:25:34.446345 agent.go:1143: adding a new peer-reflexive candidate: $remote:42324
....
ice INFO: 2020/02/04 13:26:05 Setting new connection state: Disconnected
ice INFO: 2020/02/04 13:26:05 Setting new connection state: Closed

In this example, after the call to adding a new peer-reflexive candidate: $remote:1619, I see no more traffic coming from $remote:43116 but I still see traffic coming from the other candidates.
The selected candidate pair candidate pair doesn't change though which results in the connection timing out.

While the connection is established I can receive the audio/video tracks in the browser as expected.

For some reason Firefox doesn't seem to have the same problem.
Albeit I'm seeing a single adding a new peer-reflexive candidate in that case 🤔

Any suggestions to further debug this?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions