Add Agent.restartIce(): in-place ICE restart on an existing Agent - #310
Closed
bgrozev wants to merge 1 commit into
Closed
Add Agent.restartIce(): in-place ICE restart on an existing Agent#310bgrozev wants to merge 1 commit into
bgrozev wants to merge 1 commit into
Conversation
Allows a running Agent to re-run connectivity checks against new remote credentials (and candidates) without creating a new Agent. Local credentials, local candidates and sockets are unchanged. The currently selected pair is kept in use for sending until a new pair is nominated (make-before-break): the check list and valid list are reset and re-run, but the selected pair is only replaced once a new nomination is confirmed for the restarting component. This requires relaxing two set-once guards that normally assume nomination happens only once per component: - CheckList.handleNominationConfirmed() now swaps the selected pair instead of no-oping when the component is restarting. - ConnectivityCheckClient.processSuccessResponse() now also confirms a nomination while a selected pair already exists, if the component is restarting (otherwise it treats the successful check as a keepalive and never calls nominationConfirmed()). Also un-stops the connectivity check client and cancels a pending or already-fired termination, since a steady-state Agent has its check client stopped a few seconds after completion.
This was referenced Aug 3, 2026
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #310 +/- ##
============================================
+ Coverage 36.44% 36.78% +0.34%
- Complexity 1151 1174 +23
============================================
Files 166 166
Lines 11037 11046 +9
Branches 1629 1635 +6
============================================
+ Hits 4022 4063 +41
+ Misses 6496 6458 -38
- Partials 519 525 +6
... and 16 files with indirect coverage changes Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
Agent.restartIce(): an in-place ICE restart on an already-establishedAgent, re-runningconnectivity checks against new remote credentials (and candidates) without creating a new
Agent. Localcredentials, local candidates and sockets are unchanged.
The currently selected pair is kept in use for sending until a new pair is nominated
(make-before-break): the check list and valid list are reset and re-run, but the selected pair is only
replaced once a new nomination is confirmed for the restarting component.
This required relaxing two set-once guards that normally assume nomination happens only once per
component, both gated on a new
Component.isIceRestartingflag so ordinary ICE processing is unaffected:CheckList.handleNominationConfirmed()now swaps the selected pair instead of no-oping when thecomponent is restarting.
ConnectivityCheckClient.processSuccessResponse()now also confirms a nomination while a selected pairalready exists, if the component is restarting (otherwise the successful check is treated as a
keepalive and
nominationConfirmed()is never called, so the swap never happens and the Agent neverreturns to
Completed).Also un-stops the connectivity check client and cancels a pending or already-fired termination, since a
steady-state Agent has its check client stopped and enters
Terminateda few seconds after completion.This is a leaf dependency for an in-place ICE restart feature spanning jitsi-videobridge and
lib-jitsi-meet (same branch name,
ice-restart, in both).Includes a new test,
IceRestartTest, covering the re-arm invariants over a two-agent loopbackconnection.