Repository navigation
fix(core): retry stalled ICE DNS lookups and report dropped ICE servers - #624
Merged
Merged
Conversation
resolve_ice_servers drops a STUN/TURN url whose DNS lookup misses the 2 s bound, but only said so through log::warn, which no consumer installs, so a peer that lost its only public STUN server failed every pair with no trace. Collect one notice per dropped url (resolve_with_notices) and write it to stderr and log::warn. Tests: a stalled resolver yields exactly one notice naming the url; resolved and literal urls yield none.
…ient failures A single lost UDP DNS packet made resolve_ice_servers drop the STUN/TURN url and negative-cache it for 30 s, so every peer connection in the process lost that server. On staging that removed the runner's only public STUN server and failed every ICE pair. A timeout or transient resolver error (EAI_AGAIN, timeout-like io kinds) now gets one more lookup with a fresh bound (worst case 2 x 2 s). NXDOMAIN and other definitive answers are not retried and stay negative-cached; transient failures are not cached, so the next connection looks the host up again. Tests (paused clock, scripted resolver): stall then ok keeps the url after 2 attempts; transient error then ok keeps it; stall twice drops it with one notice after 2 attempts and 4 s; NXDOMAIN is 1 attempt and cached; a timeout is not cached and the next resolve looks up again.
… answer musl reports EAI_AGAIN as 'Try again', which the old message check treated as definitive and cached for 30 s. Classify only EAI_NONAME/EAI_NODATA texts (glibc, musl, macOS) as definitive; any other error is retried once and not cached.
Merged
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.
Why
resolve_ice_serversdrops a STUN/TURN url whose DNS lookup misses the 2 s bound. One lost UDP DNS packet was enough, and the failure was negative-cached for 30 s process-wide, so every peer connection in that process lost the server. The drop was only reported throughlog::warn!, which no consumer installs. A peer that lost its only public STUN server failed every ICE pair with nothing in the logs.Change
log::warn!. Notices name the url only; credentials are separate fields.Tests (paused clock, scripted resolver)
Test plan
Verified locally and via CI; no extra manual steps.