Skip to content

Commit

Permalink
Backed out 5 changesets (bug 1602832) for browser-chrome failures at …
Browse files Browse the repository at this point in the history
…toolkit/mozapps/extensions/test/xpinstall/browser_doorhanger_installs.js on a CLOSED TREE

Backed out changeset 059a7f44d1a9 (bug 1602832)
Backed out changeset 2f3cc391b48a (bug 1602832)
Backed out changeset 24d1ce1b0ac9 (bug 1602832)
Backed out changeset 5ea85726cc48 (bug 1602832)
Backed out changeset ee00e846104e (bug 1602832)
  • Loading branch information
ccoroiu committed May 19, 2020
1 parent 7d6014b commit 44c378a
Show file tree
Hide file tree
Showing 19 changed files with 39 additions and 95 deletions.
2 changes: 0 additions & 2 deletions browser/components/doh/test/unit/xpcshell.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,4 @@ support-files =
[test_DNSLookup.js]
skip-if = debug # Bug 1617845
[test_LookupAggregator.js]
skip-if = socketprocess_networking
[test_TRRRacer.js]
skip-if = socketprocess_networking
1 change: 0 additions & 1 deletion image/test/unit/xpcshell.ini
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,3 @@ support-files =
[test_imgtools.js]
[test_moz_icon_uri.js]
[test_private_channel.js]
skip-if = socketprocess_networking
10 changes: 1 addition & 9 deletions modules/libpref/init/StaticPrefList.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7705,7 +7705,7 @@
# ("network.http.network_access_on_socket_process.enabled").
# Changing these prefs requires a restart.
- name: network.process.enabled
type: RelaxedAtomicBool
type: bool
mirror: always
#ifdef ANDROID
value: false
Expand All @@ -7723,14 +7723,6 @@
value: true
mirror: always

# Perform all network access on the socket process.
# The pref requires "network.process.enabled" to be true.
# Changing these prefs requires a restart.
- name: network.http.network_access_on_socket_process.enabled
type: RelaxedAtomicBool
mirror: always
value: false

# Telemetry of traffic categories. Whether or not to enable HttpTrafficAnalyzer.
- name: network.traffic_analyzer.enabled
type: RelaxedAtomicBool
Expand Down
5 changes: 5 additions & 0 deletions modules/libpref/init/all.js
Original file line number Diff line number Diff line change
Expand Up @@ -1584,6 +1584,11 @@ pref("network.sts.max_time_for_pr_close_during_shutdown", 5000);
// The value is expected in seconds.
pref("network.sts.pollable_event_timeout", 6);

// Perform all network access on the socket process.
// The pref requires "network.sts.socket_process.enable" to be true.
// Changing these prefs requires a restart.
pref("network.http.network_access_on_socket_process.enabled", false);

// Enable/disable sni encryption.
pref("network.security.esni.enabled", false);

Expand Down
29 changes: 22 additions & 7 deletions netwerk/base/nsIOService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ nsresult nsIOService::Init() {
observerService->AddObserver(this, NS_NETWORK_LINK_TOPIC, true);
observerService->AddObserver(this, NS_NETWORK_ID_CHANGED_TOPIC, true);
observerService->AddObserver(this, NS_WIDGET_WAKE_OBSERVER_TOPIC, true);
observerService->AddObserver(this, NS_PREFSERVICE_READ_TOPIC_ID, true);
} else
NS_WARNING("failed to get observer service");

Expand Down Expand Up @@ -456,6 +457,11 @@ nsresult nsIOService::LaunchSocketProcess() {
return NS_OK;
}

if (!XRE_IsE10sParentProcess()) {
LOG(("nsIOService skipping LaunchSocketProcess because e10s is disabled"));
return NS_OK;
}

if (!Preferences::GetBool("network.process.enabled", true)) {
LOG(("nsIOService skipping LaunchSocketProcess because of the pref"));
return NS_OK;
Expand Down Expand Up @@ -501,16 +507,15 @@ static bool sUseSocketProcess = false;
static bool sUseSocketProcessChecked = false;

// static
bool nsIOService::UseSocketProcess(bool aCheckAgain) {
if (sUseSocketProcessChecked && !aCheckAgain) {
bool nsIOService::UseSocketProcess() {
if (sUseSocketProcessChecked) {
return sUseSocketProcess;
}

sUseSocketProcessChecked = true;
sUseSocketProcess = false;
if (StaticPrefs::network_process_enabled()) {
sUseSocketProcess =
StaticPrefs::network_http_network_access_on_socket_process_enabled();
if (Preferences::GetBool("network.process.enabled")) {
sUseSocketProcess = Preferences::GetBool(
"network.http.network_access_on_socket_process.enabled", true);
}
return sUseSocketProcess;
}
Expand Down Expand Up @@ -1519,7 +1524,10 @@ nsIOService::Observe(nsISupports* subject, const char* topic,
SetOffline(false);
}
} else if (!strcmp(topic, kProfileDoChange)) {
if (data && NS_LITERAL_STRING("startup").Equals(data)) {
if (!data) {
return NS_OK;
}
if (NS_LITERAL_STRING("startup").Equals(data)) {
// Lazy initialization of network link service (see bug 620472)
InitializeNetworkLinkService();
// Set up the initilization flag regardless the actuall result.
Expand All @@ -1534,6 +1542,9 @@ nsIOService::Observe(nsISupports* subject, const char* topic,
// before something calls into the cookie service.
nsCOMPtr<nsISupports> cookieServ =
do_GetService(NS_COOKIESERVICE_CONTRACTID);
} else if (NS_LITERAL_STRING("xpcshell-do-get-profile").Equals(data)) {
// xpcshell doesn't read user profile.
LaunchSocketProcess();
}
} else if (!strcmp(topic, NS_XPCOM_SHUTDOWN_OBSERVER_ID)) {
// Remember we passed XPCOM shutdown notification to prevent any
Expand Down Expand Up @@ -1572,6 +1583,10 @@ nsIOService::Observe(nsISupports* subject, const char* topic,
// https://bugzilla.mozilla.org/show_bug.cgi?id=1152048#c19
nsCOMPtr<nsIRunnable> wakeupNotifier = new nsWakeupNotifier(this);
NS_DispatchToMainThread(wakeupNotifier);
} else if (!strcmp(topic, NS_PREFSERVICE_READ_TOPIC_ID)) {
// Launch socket process after we load user's pref. This is to make sure
// that socket process can get the latest prefs.
LaunchSocketProcess();
}

return NS_OK;
Expand Down
5 changes: 2 additions & 3 deletions netwerk/base/nsIOService.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ class nsIOService final : public nsIIOService,
bool SocketProcessReady();
static void NotifySocketProcessPrefsChanged(const char* aName, void* aSelf);
void NotifySocketProcessPrefsChanged(const char* aName);
static bool UseSocketProcess(bool aCheckAgain = false);
static bool UseSocketProcess();

bool IsSocketProcessLaunchComplete();

Expand All @@ -141,8 +141,6 @@ class nsIOService final : public nsIIOService,

static void OnTLSPrefChange(const char* aPref, void* aSelf);

nsresult LaunchSocketProcess();

private:
// These shouldn't be called directly:
// - construct using GetInstance
Expand Down Expand Up @@ -193,6 +191,7 @@ class nsIOService final : public nsIIOService,
nsIInterfaceRequestor* aCallbacks,
bool aAnonymous);

nsresult LaunchSocketProcess();
void DestroySocketProcess();

private:
Expand Down
24 changes: 2 additions & 22 deletions netwerk/dns/ChildDNSService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#include "nsQueryObject.h"
#include "mozilla/ClearOnShutdown.h"
#include "mozilla/StaticPtr.h"
#include "mozilla/SyncRunnable.h"
#include "mozilla/net/NeckoChild.h"
#include "mozilla/net/DNSListenerProxy.h"
#include "mozilla/net/TRRServiceParent.h"
Expand All @@ -36,27 +35,8 @@ already_AddRefed<ChildDNSService> ChildDNSService::GetSingleton() {
XRE_IsContentProcess() || XRE_IsSocketProcess());

if (!gChildDNSService) {
auto initTask = []() {
gChildDNSService = new ChildDNSService();
ClearOnShutdown(&gChildDNSService);
};

// For normal cases, DNS service should be initialized in nsHttpHandler. For
// some xpcshell tests, nsHttpHandler is not used at all, so the best we use
// SyncRunnable to make sure DNS service is initialized on main thread.
if (!NS_IsMainThread()) {
// Forward to the main thread synchronously.
RefPtr<nsIThread> mainThread = do_GetMainThread();
if (!mainThread) {
return nullptr;
}

SyncRunnable::DispatchToThread(
mainThread, new SyncRunnable(NS_NewRunnableFunction(
"ChildDNSService::GetSingleton", initTask)));
} else {
initTask();
}
gChildDNSService = new ChildDNSService();
ClearOnShutdown(&gChildDNSService);
}

return do_AddRef(gChildDNSService);
Expand Down
4 changes: 1 addition & 3 deletions netwerk/protocol/http/nsHttpHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -445,8 +445,6 @@ nsresult nsHttpHandler::Init() {
mIOService = new nsMainThreadPtrHolder<nsIIOService>(
"nsHttpHandler::mIOService", service);

gIOService->LaunchSocketProcess();

if (IsNeckoChild()) NeckoChild::InitNeckoChild();

InitUserAgentComponents();
Expand Down Expand Up @@ -596,7 +594,7 @@ nsresult nsHttpHandler::InitConnectionMgr() {
return NS_OK;
}

if (nsIOService::UseSocketProcess(true) && XRE_IsParentProcess()) {
if (nsIOService::UseSocketProcess() && XRE_IsParentProcess()) {
mConnMgr = new HttpConnectionMgrParent();
RefPtr<nsHttpHandler> self = this;
auto task = [self]() {
Expand Down
18 changes: 3 additions & 15 deletions netwerk/test/unit/xpcshell.ini
Original file line number Diff line number Diff line change
Expand Up @@ -305,10 +305,8 @@ fail-if = os == "android"
# http2 unit tests require us to have node available to run the spdy and http2 server
[test_http2.js]
run-sequentially = node server exceptions dont replay well
skip-if = socketprocess_networking
[test_altsvc.js]
run-sequentially = node server exceptions dont replay well
skip-if = socketprocess_networking
[test_speculative_connect.js]
[test_standardurl.js]
[test_standardurl_default_port.js]
Expand All @@ -331,14 +329,12 @@ run-sequentially = Hardcoded hash value includes port 4444.
[test_unix_domain.js]
[test_addr_in_use_error.js]
[test_about_networking.js]
skip-if = socketprocess_networking
[test_ping_aboutnetworking.js]
skip-if = (verify && (os == 'mac'))
[test_referrer.js]
[test_referrer_cross_origin.js]
[test_referrer_policy.js]
[test_predictor.js]
skip-if = socketprocess_networking
[test_signature_extraction.js]
skip-if = os != "win"
[test_synthesized_response.js]
Expand All @@ -350,7 +346,6 @@ skip-if = os != "win"
firefox-appdir = browser
[test_be_conservative_error_handling.js]
firefox-appdir = browser
skip-if = socketprocess_networking
[test_tls_server.js]
firefox-appdir = browser
[test_tls_server_multiple_clients.js]
Expand All @@ -371,7 +366,6 @@ skip-if = appname == "thunderbird"
skip-if = appname == "thunderbird"
[test_alt-data_simple.js]
[test_alt-data_stream.js]
skip-if = socketprocess_networking
[test_alt-data_too_big.js]
[test_alt-data_overwrite.js]
[test_alt-data_closeWithStatus.js]
Expand All @@ -380,11 +374,10 @@ skip-if = socketprocess_networking
[test_throttlequeue.js]
[test_throttlechannel.js]
[test_throttling.js]
skip-if = socketprocess_networking
[test_separate_connections.js]
[test_trackingProtection_annotateChannels.js]
[test_race_cache_with_network.js]
skip-if = (verify && !debug && (os == 'win')) || socketprocess_networking
skip-if = (verify && !debug && (os == 'win'))
[test_rcwn_always_cache_new_content.js]
[test_channel_priority.js]
[test_bug1312774_http1.js]
Expand All @@ -400,16 +393,14 @@ skip-if = (verify && (os == 'linux')) || (os == "android" && processor == "x86_6
run-sequentially = node server exceptions dont replay well
[test_trr.js]
# test_trr.js is not working in Thunderbird due to bug 1608066.
skip-if = appname == "thunderbird" || socketprocess_networking
skip-if = appname == "thunderbird"
[test_ioservice.js]
[test_substituting_protocol_handler.js]
[test_proxyconnect.js]
skip-if = tsan || socketprocess_networking # Bug 1614708
skip-if = tsan # Bug 1614708
[test_captive_portal_service.js]
run-sequentially = node server exceptions dont replay well
skip-if = socketprocess_networking
[test_esni_dns_fetch.js]
skip-if = socketprocess_networking
[test_network_connectivity_service.js]
[test_suspend_channel_on_authRetry.js]
[test_suspend_channel_on_examine_merged_response.js]
Expand All @@ -423,10 +414,8 @@ skip-if = socketprocess_networking
run-sequentially = one http2 node proxy is used for all tests, this test is using global session counter
skip-if = os == "android"
[test_head_request_no_response_body.js]
skip-if = socketprocess_networking
[test_disabled_ftp.js]
[test_cache_204_response.js]
skip-if = socketprocess_networking
[test_http3.js]
# disabled for now due to intermittent failures caused by neqo bugs
skip-if = true || asan || tsan || os == 'win' || os =='android'
Expand All @@ -438,4 +427,3 @@ skip-if = true || asan || tsan || os == 'win' || os =='android'
[test_dns_override.js]
[test_no_cookies_after_last_pb_exit.js]
[test_trr_httpssvc.js]
skip-if = socketprocess_networking
5 changes: 0 additions & 5 deletions netwerk/test/unit_ipc/xpcshell.ini
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ support-files =

[test_cookie_header_stripped.js]
[test_cacheflags_wrap.js]
skip-if = socketprocess_networking
[test_cache-entry-id_wrap.js]
[test_cache_jar_wrap.js]
[test_channel_close_wrap.js]
Expand All @@ -92,7 +91,6 @@ skip-if = true
[test_redirect_different-protocol_wrap.js]
[test_reentrancy_wrap.js]
[test_resumable_channel_wrap.js]
skip-if = socketprocess_networking
[test_simple_wrap.js]
[test_synthesized_response_wrap.js]
[test_xmlhttprequest_wrap.js]
Expand All @@ -102,7 +100,6 @@ skip-if = socketprocess_networking
[test_getHost_wrap.js]
[test_alt-data_simple_wrap.js]
[test_alt-data_stream_wrap.js]
skip-if = socketprocess_networking
[test_alt-data_closeWithStatus_wrap.js]
[test_original_sent_received_head_wrap.js]
[test_channel_id.js]
Expand All @@ -113,6 +110,4 @@ skip-if = socketprocess_networking
[test_alt-data_cross_process_wrap.js]
[test_httpcancel_wrap.js]
[test_esni_dns_fetch_wrap.js]
skip-if = socketprocess_networking
[test_trr_httpssvc_wrap.js]
skip-if = socketprocess_networking
1 change: 0 additions & 1 deletion security/manager/ssl/tests/unit/xpcshell.ini
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ run-sequentially = hardcoded ports
run-sequentially = hardcoded ports
[test_local_cert.js]
[test_logoutAndTeardown.js]
skip-if = socketprocess_networking
run-sequentially = hardcoded ports
[test_missing_intermediate.js]
run-sequentially = hardcoded ports
Expand Down
1 change: 0 additions & 1 deletion taskcluster/ci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ treeherder:
'X': 'Xpcshell tests'
'X-1proc': 'Xpcshell tests, without e10s'
'X-fis': 'Xpcshell tests with fission enabled'
'X-spi-nw': 'Xpcshell tests with networking on socket process'
'L10n': 'Localised Repacks'
'L10n-Rpk': 'Localized Repackaged Repacks'
'BM': 'Beetmover'
Expand Down
2 changes: 1 addition & 1 deletion taskcluster/ci/test/xpcshell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ job-defaults:
suite: xpcshell
variants:
by-test-platform:
linux1804-64/debug: ['fission', 'socketprocess_networking']
linux1804-64/debug: ['fission']
default: ['fission']
target:
by-test-platform:
Expand Down
15 changes: 1 addition & 14 deletions taskcluster/taskgraph/transforms/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,19 +203,6 @@ def fission_filter(task):
],
}
}
},
'socketprocess_networking': {
'description': "{description} with networking on socket process enabled",
'suffix': 'spi-nw',
'merge': {
'mozharness': {
'extra-options': [
'--setpref=network.process.enabled=true',
'--setpref=network.http.network_access_on_socket_process.enabled=true',
'--setpref=network.ssl_tokens_cache_enabled=true',
],
}
}
}
}

Expand Down Expand Up @@ -1308,7 +1295,7 @@ def ensure_spi_disabled_on_all_but_spi(config, tasks):
'junit' not in task['suite'] and
'raptor' not in task['suite'])

if has_setpref and variant != 'socketprocess' and variant != 'socketprocess_networking':
if has_setpref and variant != 'socketprocess':
task['mozharness']['extra-options'].append(
'--setpref=media.peerconnection.mtransport_process=false')
task['mozharness']['extra-options'].append(
Expand Down
3 changes: 0 additions & 3 deletions testing/xpcshell/runxpcshelltests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1358,9 +1358,6 @@ def updateMozinfo(self, prefs, options):
self.mozInfo['verify'] = options.get('verify', False)
self.mozInfo['webrender'] = self.enable_webrender

self.mozInfo['socketprocess_networking'] = prefs.get(
'network.http.network_access_on_socket_process.enabled', False)

mozinfo.update(self.mozInfo)

return True
Expand Down
Loading

0 comments on commit 44c378a

Please sign in to comment.