Repository navigation
p2p: sync ICE controller before send_ping_on_selected pings - #313
lonely1986 wants to merge 1 commit into
Conversation
When the controlling side selects a connection, the send_ping_on_selected_ice_controlling / send_ping_on_switch_ice_controlling field trials send an immediate ping from SwitchSelectedConnectionInternal(). However, ice_controller_->OnConnectionSwitched() was only called at the end of that function, after the ping had already been sent. The ICE controller therefore still saw the previous (or no) selected connection while deciding whether the ping should carry USE_CANDIDATE, so against an ICE-lite remote the nomination was deferred to the next scheduled ping, i.e. stable_writable_connection_ping_interval (2.5s) later, delaying DTLS. Call OnConnectionSwitched() before the immediate ping so the controller is in sync when the nomination attributes are computed. Tests: assert that the immediate ping carries use_candidate_attr() when the remote is ICE-lite in TestPingOnSwitch and TestPingOnSelected. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Some context and test status for reviewers. Problem With Fix Call What I observed on device (iOS, controlling role, ICE-lite SFU with ~230 ms RTT, field trial enabled). These lines come from a build that carries the same reordering plus extra debug logging, which is not part of this PR: i.e. the ping sent 1 ms after selection carries Tests
Status: I have verified the behavior above on device, but I have not yet run the updated unit tests locally. [Update this line once you have, e.g. "P2PTransportChannelPingTest.* passes locally".] CI shows no checks on this PR, so a maintainer-triggered run would be appreciated. |
|
mengrui seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
When the controlling side selects a connection, the send_ping_on_selected_ice_controlling / send_ping_on_switch_ice_controlling field trials send an immediate ping from SwitchSelectedConnectionInternal(). However, ice_controller_->OnConnectionSwitched() was only called at the end of that function, after the ping had already been sent. The ICE controller therefore still saw the previous (or no) selected connection while deciding whether the ping should carry USE_CANDIDATE, so against an ICE-lite remote the nomination was deferred to the next scheduled ping, i.e. stable_writable_connection_ping_interval (2.5s) later, delaying DTLS.
Call OnConnectionSwitched() before the immediate ping so the controller is in sync when the nomination attributes are computed.
Tests: assert that the immediate ping carries use_candidate_attr() when the remote is ICE-lite in TestPingOnSwitch and TestPingOnSelected.