Bug 1880491 Comment 8 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

This patch looks to be working as intended -- we make the early DNS A record lookup via the warmup coroutine and it gets used.
Note that we still make the HTTS RR record later on (more on this in a bit).

With the warmup, applink to www.nfl.com:
Note the early `A` record lookup and the `HTTPS` lookup that follows about 270ms later at `52.189114`:
```
9391	51.919297	192.168.2.5	192.168.2.1	DNS	71	Standard query 0x01ca A www.nfl.com
9501	51.949922	192.168.2.1	192.168.2.5	DNS	174	Standard query response 0x01ca A www.nfl.com CNAME global.nfl.map.fastly.net A 151.101.129.153 A 151.101.193.153 A 151.101.1.153 A 151.101.65.153
9854	52.189114	192.168.2.5	192.168.2.1	DNS	71	Standard query 0xefd3 HTTPS www.nfl.com
9861	52.219438	192.168.2.1	192.168.2.5	DNS	168	Standard query response 0xefd3 HTTPS www.nfl.com CNAME global.nfl.map.fastly.net SOA ns1.fastly.net
```

Without the warmup, applink to ww.canada.ca
Note how necko makes the two lookups, `A` and `HTTPS` at `26.588626` and `26.605788`
```
8173	26.588626	192.168.2.5	192.168.2.1	DNS	73	Standard query 0xd783 HTTPS www.canada.ca
8193	26.605788	192.168.2.5	192.168.2.1	DNS	73	Standard query 0xb3dc A www.canada.ca
8297	26.651477	192.168.2.1	192.168.2.5	DNS	164	Standard query response 0xb3dc A www.canada.ca CNAME www.canada.ca.edgekey.net CNAME e4073.dscb.akamaiedge.net A 184.26.192.192
8298	26.652391	192.168.2.1	192.168.2.5	DNS	212	Standard query response 0xd783 HTTPS www.canada.ca CNAME www.canada.ca.edgekey.net CNAME e4073.dscb.akamaiedge.net SOA n0dscb.akamaiedge.net
```

Sometimes the improvements can be seen via the performance timing api in the dom, i.e. `performance.timing`, but it's not consistent.


I don't think we'll be able to measuring anything in the applink startup test because ~45ms may be within the noise.
(And the test needs to run with a single iteration of a unique host every time).

But from the wireshark logs this looks to be a good improvement.
However, before we land this, there are a couple of items to resolve:

1 - We are planning on rolling out DoH on Android, bug 1801530,  sooner rather than later. We don't want to leak the applink host via cleartext dns when DoH is enabled, so this warmupDNS code shouldn't run in that case
2 - In bug 1852752 we enabled HTTPS resource records (we race them against A records in native DNS). This patch will mean that we end up using the HTTPS RR less frequently for applink scenarios (probably not at all). Not sure if that's critical.
This patch looks to be working as intended -- we make the early DNS A record lookup via the warmup coroutine and it gets used.
Note that we still make the HTTS RR record later on (more on this in a bit).

With the warmup, applink to www.nfl.com:
Note the early `A` record lookup and the `HTTPS` lookup that follows about 270ms later at `52.189114`:
```
9391	51.919297	192.168.2.5	192.168.2.1	DNS	71	Standard query 0x01ca A www.nfl.com
9501	51.949922	192.168.2.1	192.168.2.5	DNS	174	Standard query response 0x01ca A www.nfl.com CNAME global.nfl.map.fastly.net A 151.101.129.153 A 151.101.193.153 A 151.101.1.153 A 151.101.65.153
9854	52.189114	192.168.2.5	192.168.2.1	DNS	71	Standard query 0xefd3 HTTPS www.nfl.com
9861	52.219438	192.168.2.1	192.168.2.5	DNS	168	Standard query response 0xefd3 HTTPS www.nfl.com CNAME global.nfl.map.fastly.net SOA ns1.fastly.net
```

Without the warmup, applink to ww.canada.ca
Note how necko makes the two lookups, `A` and `HTTPS` at `26.588626` and `26.605788`
```
8173	26.588626	192.168.2.5	192.168.2.1	DNS	73	Standard query 0xd783 HTTPS www.canada.ca
8193	26.605788	192.168.2.5	192.168.2.1	DNS	73	Standard query 0xb3dc A www.canada.ca
8297	26.651477	192.168.2.1	192.168.2.5	DNS	164	Standard query response 0xb3dc A www.canada.ca CNAME www.canada.ca.edgekey.net CNAME e4073.dscb.akamaiedge.net A 184.26.192.192
8298	26.652391	192.168.2.1	192.168.2.5	DNS	212	Standard query response 0xd783 HTTPS www.canada.ca CNAME www.canada.ca.edgekey.net CNAME e4073.dscb.akamaiedge.net SOA n0dscb.akamaiedge.net
```

Sometimes the improvements can be seen via the performance timing api in the dom, i.e. `performance.timing`, but it's not consistent.


I don't think we'll be able to measure anything in the applink startup test because ~45ms is likely within the noise. (And the test needs to run with a single iteration of a unique host every time). 

But from the wireshark logs this looks to be a good improvement.
However, before we land this, there are a couple of items to resolve:

1 - We are planning on rolling out DoH on Android, bug 1801530,  sooner rather than later. We don't want to leak the applink host via cleartext dns when DoH is enabled, so this warmupDNS code shouldn't run in that case
2 - In bug 1852752 we enabled HTTPS resource records (we race them against A records in native DNS). This patch will mean that we end up using the HTTPS RR less frequently for applink scenarios (probably not at all). Not sure if that's critical.

Back to Bug 1880491 Comment 8