fix: Do not relay a transport the bridge did not restart - #1302
Conversation
A transport that carries no ice-generation is not the answer to an ICE restart: the bridge did not restart and described the Agent it already has, which it does when its transport has not connected yet. It was treated as a relayed restart anyway, with three consequences: - lastRelayedIceGeneration was set to GENERATION_UNSPECIFIED, which reset the high-water mark and lost the staleness protection for the next reordered response. A generation that had already been relayed could then be relayed again. - ice_restarts_relayed counted a restart that never happened. - The participant was sent a transport-info it has nothing to do with. It ignores it (an untagged transport does not take the ICE restart path in lib-jitsi-meet), so this was noise rather than a fault. Treat an absent generation as "the bridge kept its existing transport": log it, count it in the new ice_restarts_not_needed, and relay nothing. The staleness check no longer has to exclude untagged transports, since they never reach it.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1302 +/- ##
==========================================
+ Coverage 51.53% 51.57% +0.03%
==========================================
Files 132 132
Lines 8419 8425 +6
Branches 1285 1285
==========================================
+ Hits 4339 4345 +6
Misses 3471 3471
Partials 609 609
Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
|
Note: this comment was generated by AI (Claude Code), following on from the review comment on jitsi/jitsi-videobridge#2438 that prompted this PR. Please treat it as something to check rather than as established fact. The change reads correctly to me, and One thing left over, in a file this PR does not touch — // The bridge declined the restart (disabled in its configuration, transport not established yet,
// or shutting down). It says so by omitting the transport rather than by returning an error.Both halves of that list are now out of date, in opposite directions:
Since this PR is specifically about pinning down which shape of response means what, that comment seems like the natural thing to correct alongside it — it is currently the only place in jicofo that documents the mapping, and it now points the reader at the wrong branch for the not-established case. |
The list of reasons was wrong in both directions. A transport that is not established yet no longer omits the transport: the bridge answers with the Agent it already has, which arrives as a transport with no ice-generation and is handled by endpointIceRestarted. A failure to create the new Agent does omit it, and was not listed.
A transport with no
ice-generationin a colibri2 response is not the answer to an ICE restart. The bridge sends it when it did not restart and described the Agent it already has, which it does when its own transport has not connected yet: there is nothing to preserve, and nothing for the participant to do.ColibriV2SessionManager.endpointIceRestartedtreated it as a relayed restart:lastRelayedIceGenerationwas set toGENERATION_UNSPECIFIED, resetting the high-water mark. The staleness guard then let a generation that had already been relayed through a second time.ice_restarts_relayedcounted a restart that never happened.transport-infoit has nothing to do with. lib-jitsi-meet does not take the ICE restart path for an untagged transport, so it was ignored -- noise rather than a fault.Now an absent generation is handled for what it is: log it, count it in the new
ice_restarts_not_neededmetric, relay nothing. The staleness check no longer needs to exclude untagged transports because they never reach it.The existing test for untagged transports asserted the old behaviour and is replaced by two: the untagged transport is not relayed, and it does not lose the generation of the last one that was.
Independent of the bridge side, which is where these transports come from: jitsi/jitsi-videobridge#2438. Raised in review there: jitsi/jitsi-videobridge#2438 (comment)