Skip to content

fix: Fail the check list when the nomination of a pair fails. - #331

Open
JonathanLennox wants to merge 1 commit into
fix-double-nominationfrom
fail-checklist-on-failed-nomination
Open

JonathanLennox wants to merge 1 commit into
fix-double-nominationfrom
fail-checklist-on-failed-nomination

Conversation

@JonathanLennox

Copy link
Copy Markdown
Member

Stacked on #329; only the second commit is new here.

Problem

The controlling agent nominates only one pair for a component. When the connectivity check which nominates it failed, the pair went to the Failed state and nothing else happened: no other pair was nominated, the valid list still had a pair for the component, and so the check list stayed Running and the agent never completed or failed.

Change

When a check which we sent with USE-CANDIDATE as the controlling agent fails, and no pair has been selected for the component yet, the pair is removed from the valid list and the check list is set to Failed, as RFC 8445 section 7.2.5.3.4 requires. A check fails when it times out, gets an error response other than a role conflict, gets a non-symmetric response or a response with no mapped address, or cannot be sent.

Behaviour to be aware of

  • An agent whose nomination fails now goes to FAILED (once all its check lists have ended) where it used to stay in RUNNING.
  • Another valid pair is not nominated in place of the failed one. RFC 8445 does not allow for that without an ICE restart.
  • The controlled agent is not changed. RFC 8445 asks the same of it for a triggered check that fails, but a controlling agent which follows RFC 5245 can send USE-CANDIDATE on every check, and one of those checks failing is not a failure of the session.
  • Once a pair has been selected, the failure of a later check with USE-CANDIDATE for it is not treated as a failed nomination.

Testing

NominationFailureTest covers a timeout and an error response for the nominating check, the timeout of an ordinary check, a timeout after a pair was selected, and the controlled agent.

The controlling agent nominates only one pair for a component. When the
connectivity check which nominates it failed, the pair went to the
Failed state and nothing else happened: no other pair was nominated,
the valid list still had a pair for the component, and so the check
list stayed Running and the agent never completed or failed.

When a check which we sent with USE-CANDIDATE as the controlling agent
fails (it times out, gets an error response, a non-symmetric response
or a response with no mapped address, or cannot be sent), and no pair
has been selected for the component yet, remove the pair from the valid
list and set the check list to Failed, as RFC 8445 section 7.2.5.3.4
requires.

The controlled agent is not changed: a controlling agent which follows
RFC 5245 can send USE-CANDIDATE on every check, and one of those checks
failing is not a failure of the session.
@codecov

codecov Bot commented Dec 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 77.41935% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 44.56%. Comparing base (a010a27) to head (c2e886e).

Files with missing lines Patch % Lines
...in/java/org/ice4j/ice/ConnectivityCheckClient.java 74.07% 5 Missing and 2 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@                     Coverage Diff                     @@
##             fix-double-nomination     #331      +/-   ##
===========================================================
+ Coverage                    44.36%   44.56%   +0.19%     
- Complexity                    1462     1476      +14     
===========================================================
  Files                          166      166              
  Lines                        11227    11254      +27     
  Branches                      1663     1671       +8     
===========================================================
+ Hits                          4981     5015      +34     
+ Misses                        5623     5620       -3     
+ Partials                       623      619       -4     
Files with missing lines Coverage Δ
src/main/java/org/ice4j/ice/Agent.java 55.52% <ø> (+1.05%) ⬆️
src/main/java/org/ice4j/ice/IceMediaStream.java 73.27% <100.00%> (+0.50%) ⬆️
...in/java/org/ice4j/ice/ConnectivityCheckClient.java 65.11% <74.07%> (+4.40%) ⬆️

... and 7 files with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a010a27...c2e886e. Read the comment docs.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant