Skip to content

Commit a083a35

Browse files
docs(rtc_engine): record why the settle window cannot be replaced by ICE-state observation
Measured against a dev server: a same-node resume performs a genuine subscriber ICE restart (the server's offer carries a fresh ice-ufrag, and both transports gather a new generation), yet neither IceConnectionState nor PeerConnectionState leaves Connected at any point -- libwebrtc holds the old candidate pair until the new one is ready. So 'nothing transitioned' is the normal outcome of a healthy resume, not a symptom. Requiring an observed checking -> connected transition would time out every signal-only resume and escalate it to a full reconnect. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 2a937a9 commit a083a35

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

livekit/src/rtc_engine/mod.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,14 @@ pub(crate) type EngineResult<T> = Result<T, EngineError>;
6767
/// The cost is resume latency for a signal-only failure, where the media plane was fine and
6868
/// there is no reconnection to short-circuit on. Resume-only; a full reconnect builds new
6969
/// PeerConnections and has no stale state to misread.
70+
///
71+
/// This window cannot be replaced by watching for an ICE restart to take effect. Measured
72+
/// against a dev server, a same-node resume does perform a real subscriber ICE restart — the
73+
/// server's offer carries a fresh ice-ufrag and both transports gather a new generation — yet
74+
/// neither `IceConnectionState` nor `PeerConnectionState` leaves `Connected` at any point,
75+
/// because libwebrtc keeps the old candidate pair selected until the new one is ready. So
76+
/// "nothing transitioned" is the *normal* outcome of a healthy resume, and requiring an
77+
/// observed transition would time out every signal-only resume into a full reconnect.
7078
pub const PC_RECONNECT_SETTLE_DELAY: Duration = Duration::from_secs(3);
7179

7280
#[derive(Debug, Clone, Copy, Eq, PartialEq)]

0 commit comments

Comments
 (0)