Skip to content

Avoid triggered checks from ICE-lite agents#921

Closed
zshang-oai wants to merge 1 commit into
mainfrom
codex/ice-lite-no-triggered-check
Closed

Avoid triggered checks from ICE-lite agents#921
zshang-oai wants to merge 1 commit into
mainfrom
codex/ice-lite-no-triggered-check

Conversation

@zshang-oai

Copy link
Copy Markdown
Contributor

Summary

  • add an ICE-lite HandleBindingRequest path that responds without originating triggered checks
  • mark accepted USE-CANDIDATE / nomination requests as succeeded before reusing the controlled nomination handling
  • add a regression covering accepted ICE-lite nomination without an outbound triggered check

Why

ICE-lite agents act only as STUN servers. Reusing the full controlled-agent request path caused the lite side to originate a triggered connectivity check, adding an unnecessary RTT before the pair became selected. For accepted nomination requests, RFC 8445 section 7.3.2 lets the lite side treat the pair as valid/nominated from the inbound request path instead.

Validation

  • go test ./... -run 'TestLiteSelector_NoTriggeredCheckForAcceptedNomination|TestControlledSelector_TriggeredCheckDuringChecking|TestControlledSelector_NoTriggeredCheckAfterConnected' -count=1
  • attempted go test ./...; it timed out in TestMulticastDNSOnlyConnection in this local environment after about 117s

@codecov

codecov Bot commented May 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.50%. Comparing base (6e0640f) to head (9acc6a5).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #921      +/-   ##
==========================================
+ Coverage   88.44%   88.50%   +0.05%     
==========================================
  Files          45       45              
  Lines        5886     5898      +12     
==========================================
+ Hits         5206     5220      +14     
+ Misses        469      468       -1     
+ Partials      211      210       -1     
Flag Coverage Δ
go 88.50% <100.00%> (+0.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@zshang-oai zshang-oai force-pushed the codex/ice-lite-no-triggered-check branch from 9936440 to 9acc6a5 Compare May 19, 2026 16:33
@zshang-oai zshang-oai marked this pull request as ready for review May 19, 2026 16:35
@zshang-oai zshang-oai requested review from JoTurk, Sean-Der and Copilot May 19, 2026 16:35
@zshang-oai zshang-oai marked this pull request as draft May 19, 2026 16:35
@JoTurk

JoTurk commented May 19, 2026

Copy link
Copy Markdown
Member

@zshang-oai There is an already a PR to solve this issue #909 I just need to test it more, We also need to be careful because we don't handle ice-lite controlling mode yet.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adjusts ICE-lite behavior so that lite agents (which act only as STUN servers) do not originate triggered connectivity checks when handling inbound Binding Requests—particularly for accepted nominations—removing an unnecessary RTT before pair selection.

Changes:

  • Refactored controlledSelector.HandleBindingRequest to share logic via an internal helper and gate triggered checks behind a pingCandidate flag.
  • Added a dedicated ICE-lite HandleBindingRequest path that responds without sending triggered checks, while still allowing nomination handling to select the pair immediately.
  • Added a regression test ensuring an accepted ICE-lite nomination does not result in an outbound triggered check.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
selection.go Introduces a shared controlled binding-request handler with an option to suppress triggered checks; adds ICE-lite binding-request behavior that avoids outbound checks.
selection_test.go Adds a regression test verifying ICE-lite accepted nominations select the pair without sending triggered checks.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread selection.go
@@ -424,6 +424,15 @@ func (s *controlledSelector) HandleSuccessResponse(m *stun.Message, local, remot
}

func (s *controlledSelector) HandleBindingRequest(message *stun.Message, local, remote Candidate) { //nolint:cyclop
@zshang-oai

Copy link
Copy Markdown
Contributor Author

@JoTurk Oh did not realize that, sorry and thank you

@zshang-oai zshang-oai closed this May 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants