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

117 Коммитов

Автор SHA1 Сообщение Дата
Kershaw Chang 9153fef79a Bug 1766137 - Avoid holding the lock when calling nsThread::Shutdown, r=necko-reviewers,dragana
Differential Revision: https://phabricator.services.mozilla.com/D146280
2022-05-18 13:01:32 +00:00
Bogdan Szekely f2c042e0e7 Merge autoland to mozilla-central. a=merge 2022-05-13 12:34:36 +03:00
Randell Jesup 39e3372695 Bug 1207753 - netwerk/dns thread-safety annotations r=necko-reviewers,dragana
Differential Revision: https://phabricator.services.mozilla.com/D130580
2022-05-12 21:55:01 +00:00
Kershaw Chang 9fa0fc717a Bug 1762201 - Make sure ConfirmationContext::RecordEvent is locked, r=necko-reviewers,dragana
Differential Revision: https://phabricator.services.mozilla.com/D144022
2022-04-22 09:39:31 +00:00
Randell Jesup fcaf70841e Bug 1207753 - Add MOZ_UNANNOTATED to all Mutexes/Monitors r=nika,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D140849
2022-03-16 18:47:08 +00:00
Noemi Erli 2390d257e6 Backed out changeset 12a59e5a50bf (bug 1207753) for causing build bustage CLOSED TREE 2022-03-16 18:32:51 +02:00
Randell Jesup 4b033a5256 Bug 1207753 - Add MOZ_UNANNOTATED to all Mutexes/Monitors r=nika,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D140849
2022-03-16 16:16:14 +00:00
Butkovits Atila 927ad62c6a Backed out changeset a68ee4b09f92 (bug 1207753) for causing Hazard bustages. CLOSED TREE 2022-03-16 14:38:14 +02:00
Randell Jesup 7d4b5fae04 Bug 1207753 - Add MOZ_UNANNOTATED to all Mutexes/Monitors r=nika,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D140849
2022-03-16 12:01:14 +00:00
Kershaw Chang 3a7cb38fc0 Bug 1755877 - Fix the race on mConfirmation.TaskAddr(), r=necko-reviewers,valentin
Since TRRService::MaybeSetPrivateURI() is the only case that can triggers a new confirmation when TRRService::ReadPrefs() is called, making ConfirmationContext::Handle() returns a boolean value should be enough for this case.

Differential Revision: https://phabricator.services.mozilla.com/D139107
2022-02-21 12:23:19 +00:00
Valentin Gosu f2ce1bed77 Bug 1743022 - Rename network.trr.blacklist-duration to network.trr.temp_blocklist_durations_sec r=necko-reviewers,kershaw
Also turns it into a static pref r=#necko

Differential Revision: https://phabricator.services.mozilla.com/D136530
2022-01-25 15:57:03 +00:00
Sandor Molnar 9341f771cd Backed out 2 changesets (bug 1743022) for causing xpc failures in test_trr_blocklist. CLOSED TREE
Backed out changeset 1acf0c8e8663 (bug 1743022)
Backed out changeset e8822e38828f (bug 1743022)
2022-01-21 22:23:59 +02:00
Valentin Gosu e382a176b2 Bug 1743022 - Rename network.trr.blacklist-duration to network.trr.temp_blocklist_durations_sec r=necko-reviewers,kershaw
Also turns it into a static pref r=#necko

Differential Revision: https://phabricator.services.mozilla.com/D136530
2022-01-21 18:54:28 +00:00
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