Closed Bug 1998646 Opened 9 months ago Closed 5 months ago

Increase priority of DoH/DNS runnables.

Categories

(Core :: Networking: DNS, task, P2)

task

Tracking

()

RESOLVED DUPLICATE of bug 2009372

People

(Reporter: valentin, Assigned: valentin)

References

Details

(Whiteboard: [necko-triaged] [necko-priority-next])

Attachments

(1 obsolete file)

See (In reply to Valentin Gosu [:valentin] (he/him) from bug 1994314 comment #9)

I think the delay makes sense.
The socket thread is busy, so the processing of the transaction dispatched from mozilla::net::TRRServiceChannel::Connect will wait in the queue behind other things.
Then when the DoH response is received, we'll process the sockets in order mozilla::net::nsSocketTransportService::DoPollIteration, so we might actually do other things rather than process the DoH response.
Then we read from the socket, the data goes to the TRR thread, we parse the packet, we call nsHostResolver::CompleteLookupLocked, which then goes to mozilla::net::DNSListenerProxy::OnLookupComplete that dispatches to the original thread that called AsyncResolve. In the common case when the resolution was triggered from mozilla::net::DnsAndConnectSocket::TransportSetup::ResolveHost this was the socket thread, so we need to wait for event queue to be processed yet again in order for the connection to proceed.

  1. Increasing the priority of the runnables posted to the socket thread:

We want to increase the priority of DNS runnables, as that is likely to make channels be dispatched a bit faster.

In this try push I included the patch from this bug to increase the priority of the DNSListenerProxy::OnLookupComplete runnable.
From a very quick look at a resulting profile, this does not appear to be the bottleneck because I still see many 300-600ms trr lookups.
https://share.firefox.dev/49wco4J

Related, in bug 2007582 I'm adding more CI dns tests, trr and OS resolver.

Blocks: 2009372
Status: NEW → RESOLVED
Closed: 5 months ago
Duplicate of bug: 2009372
Resolution: --- → DUPLICATE
Attachment #9524978 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: