Family-specific DNS lookups (RESOLVE_DISABLE_IPV4/RESOLVE_DISABLE_IPV6) cannot coalesce onto a pending AF_UNSPEC lookup
Categories
(Core :: Networking: DNS, defect, P2)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox153 | --- | fixed |
People
(Reporter: kershaw, Assigned: kershaw)
References
(Blocks 1 open bug)
Details
(Whiteboard: [necko-triaged])
Attachments
(2 files)
A family-restricted DNS request — RESOLVE_DISABLE_IPV6 or RESOLVE_DISABLE_IPV4 — cannot attach to an in-flight AF_UNSPEC lookup for the same host. Instead, it starts its own DNS lookup, duplicating work that the pending unspec lookup would already produce.
In Happy Eyeballs, HappyEyeballsConnectionAttempt::SetupDnsFlags sets RESOLVE_DISABLE_IPV4 / RESOLVE_DISABLE_IPV6 for its per-family A/AAAA queries. If the channel has already issued an AF_UNSPEC DNS prefetch (nsHttpChannel::MaybeStartDNSPrefetch) and that lookup is still pending, the HE per-family lookups cannot append their callbacks to it. As a result, the host may be resolved up to three times concurrently: the unspec prefetch plus one per family.
DNS queries are cheap. In addition, they take up a tiny fraction of connection establishment time. With that in mind, why not a P3 instead of a P2? Not opposed to fixing it eventually.
| Assignee | ||
Comment 2•1 month ago
|
||
Before Happy Eyeballs starts connection establishment, we often already have a DNS prefetch in flight or completed. Ideally, the HE lookups should be able to reuse that result directly from the DNS cache instead of issuing more lookups.
The problem is that we are wasting the prefetch work we already did, and this also shows up as a DNS lookup timing regression in our metrics. That’s why I think P2 is reasonable.
| Assignee | ||
Comment 3•1 month ago
|
||
Depends on D304712
Updated•1 month ago
|
| Assignee | ||
Comment 4•1 month ago
|
||
Depends on D304713
Comment 6•1 month ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/5c8cbed9b328
https://hg.mozilla.org/mozilla-central/rev/14ddf930513c
Updated•1 month ago
|
Description
•