Граф коммитов

104 Коммитов

Автор SHA1 Сообщение Дата
Nihanth Subramanya a2d8d6fe02 Bug 1737198 - Part 8: Expose Confirmation State for testing. r=kershaw,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D132671
2021-12-02 13:21:55 +00:00
Nihanth Subramanya 232120db57 Bug 1737198 - Part 1: Cycle DoH connection and retry upon lookup failure. r=necko-reviewers,valentin,dragana
1. When we see a failed TRR lookup in nsHostResolver::CompleteLookup, we trigger
a Confirmation and retry the lookup.
2. When triggering Confirmation, we set LOAD_FRESH_CONNECTION on the TRR channel,
which will then tell the connection manager to clear out the current TRR conneection.
This will cause us to use a new connection for the Confirmation and subsequent
lookups.

Differential Revision: https://phabricator.services.mozilla.com/D129227
2021-12-02 13:21:53 +00:00
Noemi Erli 56a43f9e9e Backed out 9 changesets (bug 1743122, bug 1737198) for causing assertion failure in TRRServiceChild.cpp CLOSED TREE
Backed out changeset 044390f37a8f (bug 1743122)
Backed out changeset d742fcfb8fad (bug 1737198)
Backed out changeset 9e4b52c06e3c (bug 1737198)
Backed out changeset 546b0f714a4d (bug 1737198)
Backed out changeset 189ed6145945 (bug 1737198)
Backed out changeset 3bab6f5b5b6b (bug 1737198)
Backed out changeset cdc9de540f2f (bug 1737198)
Backed out changeset e981d9e9c11c (bug 1737198)
Backed out changeset 04a75a837de9 (bug 1737198)
2021-12-02 13:40:57 +02:00
Nihanth Subramanya 85b21b5669 Bug 1737198 - Part 8: Expose Confirmation State for testing. r=kershaw,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D132671
2021-12-02 10:13:36 +00:00
Nihanth Subramanya 0fc7da72e9 Bug 1737198 - Part 1: Cycle DoH connection and retry upon lookup failure. r=necko-reviewers,valentin,dragana
1. When we see a failed TRR lookup in nsHostResolver::CompleteLookup, we trigger
a Confirmation and retry the lookup.
2. When triggering Confirmation, we set LOAD_FRESH_CONNECTION on the TRR channel,
which will then tell the connection manager to clear out the current TRR conneection.
This will cause us to use a new connection for the Confirmation and subsequent
lookups.

Differential Revision: https://phabricator.services.mozilla.com/D129227
2021-12-02 10:13:33 +00:00
criss a587690d98 Backed out 9 changesets (bug 1737198, bug 1743122) by dev request. CLOSED TREE
Backed out changeset 8ea0830f0ebc (bug 1743122)
Backed out changeset 5d68e2b664cc (bug 1737198)
Backed out changeset c43e8d579121 (bug 1737198)
Backed out changeset 7c257276a971 (bug 1737198)
Backed out changeset 05e67f464ee1 (bug 1737198)
Backed out changeset 04bae7f14cec (bug 1737198)
Backed out changeset b703cf81d197 (bug 1737198)
Backed out changeset 6f1e88c3daf3 (bug 1737198)
Backed out changeset 960ecb376a56 (bug 1737198)
2021-12-02 11:57:08 +02:00
Nihanth Subramanya b805de3013 Bug 1737198 - Part 8: Expose Confirmation State for testing. r=kershaw,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D132671
2021-12-02 09:40:54 +00:00
Nihanth Subramanya 66fb0a17d5 Bug 1737198 - Part 1: Cycle DoH connection and retry upon lookup failure. r=necko-reviewers,valentin,dragana
1. When we see a failed TRR lookup in nsHostResolver::CompleteLookup, we trigger
a Confirmation and retry the lookup.
2. When triggering Confirmation, we set LOAD_FRESH_CONNECTION on the TRR channel,
which will then tell the connection manager to clear out the current TRR conneection.
This will cause us to use a new connection for the Confirmation and subsequent
lookups.

Differential Revision: https://phabricator.services.mozilla.com/D129227
2021-12-02 09:40:51 +00:00
Alexandru Michis 045fc2e5f4 Backed out 8 changesets (bug 1737198, bug 1743122) for causing xpcshell failures in unit/test_trr.js
CLOSED TREE

Backed out changeset 525922fbae63 (bug 1743122)
Backed out changeset f370d8070271 (bug 1737198)
Backed out changeset 84a05e5b5e8d (bug 1737198)
Backed out changeset f7eeff0744f4 (bug 1737198)
Backed out changeset ae860da29fd4 (bug 1737198)
Backed out changeset 827456b1b2e8 (bug 1737198)
Backed out changeset 2ebd361d8512 (bug 1737198)
Backed out changeset c3b726205642 (bug 1737198)
2021-12-01 20:31:09 +02:00
Nihanth Subramanya eca944c48c Bug 1737198 - Part 1: Cycle DoH connection and retry upon lookup failure. r=necko-reviewers,valentin,dragana
1. When we see a failed TRR lookup in nsHostResolver::CompleteLookup, we trigger
a Confirmation and retry the lookup.
2. When triggering Confirmation, we set LOAD_FRESH_CONNECTION on the TRR channel,
which will then tell the connection manager to clear out the current TRR conneection.
This will cause us to use a new connection for the Confirmation and subsequent
lookups.

Differential Revision: https://phabricator.services.mozilla.com/D129227
2021-12-01 17:32:17 +00:00
Marian-Vasile Laza 9f1578bb4f Backed out 8 changesets (bug 1743122, bug 1737198) for causing build bustages on nsHostRecord.cpp. CLOSED TREE
Backed out changeset 83df9b71c3f8 (bug 1743122)
Backed out changeset 0b7bc91852a5 (bug 1737198)
Backed out changeset 595e81cc111c (bug 1737198)
Backed out changeset ac08b423bc60 (bug 1737198)
Backed out changeset 956ddc990493 (bug 1737198)
Backed out changeset 480e925ab804 (bug 1737198)
Backed out changeset 17276ab6d127 (bug 1737198)
Backed out changeset 45b749688e6f (bug 1737198)
2021-12-01 01:12:34 +02:00
Nihanth Subramanya 5914463d03 Bug 1737198 - Part 1: Cycle DoH connection and retry upon lookup failure. r=necko-reviewers,valentin,dragana
1. When we see a failed TRR lookup in nsHostResolver::CompleteLookup, we trigger
a Confirmation and retry the lookup.
2. When triggering Confirmation, we set LOAD_FRESH_CONNECTION on the TRR channel,
which will then tell the connection manager to clear out the current TRR conneection.
This will cause us to use a new connection for the Confirmation and subsequent
lookups.

Differential Revision: https://phabricator.services.mozilla.com/D129227
2021-11-30 22:02:12 +00:00
Kershaw Chang 478d192351 Bug 1739001 - Pre-fetch connection info for TRRServiceChannel, r=necko-reviewers,valentin,nhnt11
Differential Revision: https://phabricator.services.mozilla.com/D130814
2021-11-29 15:19:15 +00:00
Florian Quèze 998adb18ea Bug 1728760 - require all nsITimerCallback native implementations to also implement nsINamed, r=smaug.
Differential Revision: https://phabricator.services.mozilla.com/D124349
2021-09-07 08:01:18 +00:00
Kershaw Chang 298fea6ff9 Bug 1719135 - Make gTRRService atomic and also avoid doing trrLookup when trr service is not ready, r=necko-reviewers,dragana
Differential Revision: https://phabricator.services.mozilla.com/D120621
2021-07-26 09:37:37 +00:00
Valentin Gosu 2f83f1a6f4 Bug 1699660 - Create ConfirmationWrapper to enforce logic separation r=necko-reviewers,dragana
This is needed because TRRService is a friend class of TRRService
(needed to provide access to private constructor). If we find a way to
have a friend destructor method then we would not need the wrapper.

Differential Revision: https://phabricator.services.mozilla.com/D113312
2021-05-03 09:09:19 +00:00
Valentin Gosu 6a9335258f Bug 1699660 - Make HandleConfirmationEvent a member function of ConfirmationContext r=necko-reviewers,dragana
Differential Revision: https://phabricator.services.mozilla.com/D113310
2021-05-03 09:09:18 +00:00
Valentin Gosu 5b5fc756c9 Bug 1699660 - Move TRRIsOkay logic to ConfirmationContext and rename to RecordTRRStatus r=necko-reviewers,dragana
Differential Revision: https://phabricator.services.mozilla.com/D113309
2021-05-03 09:09:18 +00:00
Valentin Gosu 57a752e892 Bug 1699660 - Make CompleteConfirmation a member of TRRService::ConfirmationContext r=necko-reviewers,dragana
Differential Revision: https://phabricator.services.mozilla.com/D113308
2021-05-03 09:09:17 +00:00
Valentin Gosu 0d38e8c1db Bug 1699660 - Make TRRService::ConfirmationContext implement nsITimerCallback r=necko-reviewers,dragana
Differential Revision: https://phabricator.services.mozilla.com/D113307
2021-05-03 09:09:17 +00:00
Simon Giesecke 705461265d Bug 708901 - Migrate to nsTHashSet in netwerk. r=necko-reviewers,valentin
Depends on D108600

Differential Revision: https://phabricator.services.mozilla.com/D108601
2021-03-23 10:36:35 +00:00
Valentin Gosu 45d5e3c349 Bug 1658278 - Add TRR confirmation test r=necko-reviewers,dragana,nhnt11
Also adds nsIDNSService.currentTrrConfirmationState IDL method for test use

Differential Revision: https://phabricator.services.mozilla.com/D108999
2021-03-19 17:51:27 +00:00
Valentin Gosu 47cd0f08de Bug 1658278 - Split TRR's CONFIRM_TRYING into CONFIRM_TRYING_OK and CONFIRM_TRYING_FAILED r=necko-reviewers,nhnt11,dragana,preferences-reviewers
- Adds CONFIRM_TRYING_FAILED confirmation state. We use this state when we retry confirmation after confirmation fails.
- Rename CONFIRM_TRYING to CONFIRM_TRYING_OK. We use this state when we try confirmation but no confirmation failure has happened.
- Rename CONFIRM_INIT to CONFIRM_OFF. We use this state whenever there is an event that would disable TRR - such as a TRR mode change.
- Add CONFIRM_DISABLED confirmation state. We use this state in mode3 or when confirmationNS=="skip"
- To potentially allow us to have the same behaviour as after Bug 1689113, specifically the we might be able to report TRRService::Enabled = true when retrying and the state is CONFIRM_TRYING_FAILED we added `network.trr.attempt-when-retrying-confirmation`
- After a large number of TRR failures occurs, we immediately trigger another confirmation and go into CONFIRM_TRYING_OK. This allows us to cope with a temporary increase in network latency that is smaller than 6s.
- We no longer trigger confirmation for nsIRequest::TRR_FIRST_MODE when the resolver mode is not TRR_FIRST. This allows us to simplify the code.
- test_trr_proxy.js now calls trr_test_setup() after it sets up the pac script to avoid confirmation causing non-local connections in tests.
- Moves all the confirmation state handing into HandleConfirmationEvent

Differential Revision: https://phabricator.services.mozilla.com/D107666
2021-03-19 17:51:26 +00:00
Valentin Gosu 8e80fa3f32 Bug 1658278 - Move member initialization to header file r=necko-reviewers,dragana
Differential Revision: https://phabricator.services.mozilla.com/D107665
2021-03-19 17:51:26 +00:00
Valentin Gosu 0aea403b8a Bug 1658278 - Treat calls to TRRService::CompleteLookup differently based on the purpose of the TRR request r=necko-reviewers,dragana
Differential Revision: https://phabricator.services.mozilla.com/D107664
2021-03-19 17:51:25 +00:00
Simon Giesecke ad01a10a3b Bug 1634281 - Use nsTHashMap instead of nsDataHashtable. r=xpcom-reviewers,necko-reviewers,jgilbert,nika,valentin
Note that this patch only transforms the use of the nsDataHashtable type alias
to a directly equivalent use of nsTHashMap. It does not change the specification
of the hash key type to make use of the key class deduction that nsTHashMap
allows for in some cases. That can be done in a separate step, but requires more
attention.

Differential Revision: https://phabricator.services.mozilla.com/D106008
2021-03-10 10:47:47 +00:00
Valentin Gosu a13ad605e4 Bug 1694949 - Add event telemetry containing failure reasons that lead to TRR confirmation failure r=nhnt11,dragana,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D106618
2021-03-03 14:32:24 +00:00
Valentin Gosu ff32c214b6 Bug 1694604 - Move TRRSkippedReason out of nsHostResolver.h r=necko-reviewers,dragana
Differential Revision: https://phabricator.services.mozilla.com/D106262
2021-02-24 16:37:03 +00:00
Valentin Gosu a9cce9ac08 Bug 1646452 - Key TRR telemetry by domain of DoH server r=nhnt11,necko-reviewers,dragana
This allows us to separate general TRR performance issues from "this user's
custom DoH server is slow or malfunctioning".
Any DoH servers domains that are not shipped by Firefox are reported as (other).

Differential Revision: https://phabricator.services.mozilla.com/D105602
2021-02-22 13:51:44 +00:00
Valentin Gosu efa654d3d5 Bug 1691408 - Record confirmation event telemetry r=nhnt11,dragana,necko-reviewers
- Adds new TRR* argument to CompleteLookup so we can extract the channel
  status from the TRR request.
- Record event whenever the confirmation context changes
- NetworkID is recorded whenever we start a new confirmation attempt
- Captive portal status is updated based on observer notifications
- We keep a buffer of the last 32 confirmation results.

Differential Revision: https://phabricator.services.mozilla.com/D105173
2021-02-17 10:26:41 +00:00
Nihanth Subramanya c206347e88 Bug 1689113 - Don't skip TRR unless confirmation explicitly failed. r=necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D103170
2021-02-04 17:34:27 +00:00
Kershaw Chang 19e0167786 Bug 1684040 - P1: Introduce new ODoH class for sending ODoH queries r=necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D101682
2021-01-26 14:19:09 +00:00
Mihai Alexandru Michis 51b7d9634a Backed out 3 changesets (bug 1684040) for causing bustages in DNSPacket.cpp
CLOSED TREE

Backed out changeset 3c771d45563a (bug 1684040)
Backed out changeset 76e79151d53c (bug 1684040)
Backed out changeset 7a993eb7bfde (bug 1684040)
2021-01-26 16:15:12 +02:00
Kershaw Chang cffa2368ca Bug 1684040 - P1: Introduce new ODoH class for sending ODoH queries r=necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D101682
2021-01-26 12:41:40 +00:00
Simon Giesecke 971b645fe3 Bug 1660470 - Add missing include directives/forward declarations. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D87865
2020-11-23 16:21:38 +00:00
Valentin Gosu b9501927ed Bug 1616252 - Exclude domains in /etc/hosts from using TRR r=necko-reviewers,dragana
This patch adds a task that is dispatched to the background thread when TRR
is first enabled. This may mean during the TRRService initialization at
startup or later when the pref is flipped.

The task will call into rust_parse_etc_hosts which does the actual file
opening and parsing. We pass the path to the file, that being either
/etc/hosts or the Windows equivalent obtained by calling
SHGetSpecialFolderPathA.

The rust code opens the file and proceeds to read it line by line while
accumulating all the hostnames in an array. Since these files can be
quite large, on the order of several megabytes, we need to make sure we
don't block shutdown doing this - so once more than 100 domains have
accumulated in the array we call back into C++ code to add them to the
exclusion list. The callback will return true if we should continue to
parse the file or false otherwise.

We also change the tests to use "excluded" rather than localhost when
testing the excluded-domains prefs, since localhost is unually present
in /etc/hosts and may interfere with the test.

We also use an atomic sTRRServicePtr to make sure that we don't have
a data race between the TRRService being freed and the callbacks of the
parsing.

Differential Revision: https://phabricator.services.mozilla.com/D90663
2020-10-01 07:01:58 +00:00
Valentin Gosu 8e8a6ed3eb Bug 1660975 - Move some TRR prefs to StaticPrefList.yaml r=nhnt11
Differential Revision: https://phabricator.services.mozilla.com/D88123
2020-08-31 12:49:59 +00:00
Valentin Gosu f901db3225 Bug 1657897 - Remove code that bypasses TRR when platform indications are triggered r=dragana,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D86367
2020-08-11 13:51:56 +00:00
Valentin Gosu 05e121315d Bug 1650356 - Make the TRRBLStorage a hashtable r=dragana,necko-reviewers
We also wrap it in a DataMutex to allow use on any thread

Differential Revision: https://phabricator.services.mozilla.com/D82220
2020-07-11 19:32:45 +00:00
Valentin Gosu 0606ff0236 Bug 1650356 - Rename TRR Blacklist to TRR blocklist r=dragana,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D82219
2020-07-11 19:32:27 +00:00
Valentin Gosu 4106c61ff1 Bug 1649143 - Record telemetry with reason we fell back to Do53 r=dragana,necko-reviewers
This patch attempts to record the reason why we fall back to DNS.
I considered using categorical probes for this, but they have a max limit of
20 categories, so we have to use a linear probe. I chose 50 buckets to allow
us to add more failure reasons in the future.

The recorded values are defined in nsHostRecord::TRRSkippedReason.
nsHostRecord::RecordReason is called whenever we encounter a condition that
will cause us to skip TRR in nsHostResolver.

For failures that occur inside TRR.cpp, each TRR object holds its own reason
that is recorded in a similar way. When all TRR requests are complete we
report the one that failed (or if both failed we report the one for the A
request).

Due to the fact that we might also follow CNAME requests, and the final
TRR request might not be the one that was issued at first, TRR requests
must pass back the reason as an argument to CompleteLookup.

Finally, this patch records the reason in two probes:
TRR_SKIP_REASON_TRR_FIRST - only reported in TRR-first mode
TRR_SKIP_REASON_DNS_WORKED - only reported in TRR-first mode when the
  fallback DNS request succeeded. This allows us to filter for complete
  network failures.

Differential Revision: https://phabricator.services.mozilla.com/D82168
2020-07-11 19:32:05 +00:00
Kershaw Chang 87c26faa97 Bug 1637648 - P2: Make TRRServiceParent use nsIOService to forward observer notifications r=dragana
Differential Revision: https://phabricator.services.mozilla.com/D77306
2020-06-23 11:11:16 +00:00
Valentin Gosu 243786d713 Bug 1640867 - Add new HTTP_CHANNEL_ONSTART_SUCCESS_TRR probe r=dragana,tdsmith,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D77127
2020-05-30 08:39:17 +00:00
Valentin Gosu 23ea06d309 Bug 1640867 - Record TRR steering telemetry separately r=dragana,tdsmith,necko-reviewers
This change makes a set of probes keyed. The key is "(default)" if no steering
is currently active, or "(auto-detected)" is the current URL has been set
by steering (autodetection).

Differential Revision: https://phabricator.services.mozilla.com/D77022
2020-05-30 08:39:02 +00:00
Dorel Luca ca47e808e1 Backed out 2 changesets (bug 1640867) for Network failures on multipe platforms. CLOSED TREE
Backed out changeset 75a1f56ff1ee (bug 1640867)
Backed out changeset a4c770a70516 (bug 1640867)
2020-05-30 02:02:33 +03:00
Valentin Gosu 5a7c7bf9ec Bug 1640867 - Add new HTTP_CHANNEL_ONSTART_SUCCESS_TRR probe r=dragana,tdsmith,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D77127
2020-05-29 21:23:50 +00:00
Valentin Gosu 5570291ec4 Bug 1640867 - Record TRR steering telemetry separately r=dragana,tdsmith,necko-reviewers
This change makes a set of probes keyed. The key is "(default)" if no steering
is currently active, or "(auto-detected)" is the current URL has been set
by steering (autodetection).

Differential Revision: https://phabricator.services.mozilla.com/D77022
2020-05-29 21:23:41 +00:00
Kershaw Chang e523bf4175 Bug 1539819 - P5: Extract the logic of processing TRRService URI r=valentin
Differential Revision: https://phabricator.services.mozilla.com/D73903
2020-05-18 20:18:15 +00:00
Kershaw Chang bdbecde447 Bug 1539819 - P1: Make TRRService work in socket process r=dragana,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D68880
2020-05-18 20:18:03 +00:00
Valentin Gosu 197dbfbdde Bug 1634462 - Add doh-rollout.mode pref check and mode change notification r=dragana,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D74316
2020-05-13 13:37:02 +00:00