gecko-dev/toolkit/components/backgroundtasks
Bobby Holley 502d68439f Bug 1734750 - Stop force-disabling the socket process for background tasks. r=nalexander
This was causing issues in socket-process xpcshell tests for the gecko-based pingsender.

The spi-nw configuration [1] passes `--setpref=network.http.network_access_on_socket_process.enabled=true` to xpcshell tests. The xpcshell harness reads this pref [2] to set self.mozInfo["socketprocess_networking"], and then later uses it to set MOZ_FORCE_USE_SOCKET_PROCESS in the enviroment [3]. However, the backgroundtask machinery also disables the socket process pref on startup [4].

This activates a mismatch between nsIOService::UseSocketProcess, which checks MOZ_FORCE_USE_SOCKET_PROCESS [5], and nsIOService::LaunchSocketProcess, which doesn't [6]. The net result is that necko is inoperable, because part of the system thinks there should be a socket process and part of the system thinks the converse.

We could solve this mismatch by making LaunchSocketProcess check MOZ_FORCE_USE_SOCKET_PROCESS, but that would simply override the attempt to disable the socket process in backgroundtasks.js. According to Nick, disabling the socket process for background tasks was just done to avoid a crash, and that crash appears to be gone. So we just remove that special-casing.

[1] https://searchfox.org/mozilla-central/rev/b847c844adf49013067281d3237e7ada24325a34/taskcluster/gecko_taskgraph/transforms/tests.py#329
[2] https://searchfox.org/mozilla-central/rev/b847c844adf49013067281d3237e7ada24325a34/testing/xpcshell/runxpcshelltests.py#1526
[3] https://searchfox.org/mozilla-central/rev/b847c844adf49013067281d3237e7ada24325a34/testing/xpcshell/runxpcshelltests.py#1198
[4] https://searchfox.org/mozilla-central/rev/b847c844adf49013067281d3237e7ada24325a34/toolkit/components/backgroundtasks/defaults/backgroundtasks.js#8
[5] https://searchfox.org/mozilla-central/rev/b847c844adf49013067281d3237e7ada24325a34/netwerk/base/nsIOService.cpp#583
[6] https://searchfox.org/mozilla-central/rev/b847c844adf49013067281d3237e7ada24325a34/netwerk/base/nsIOService.cpp#505

Differential Revision: https://phabricator.services.mozilla.com/D127906
2021-10-08 23:45:49 +00:00
..
defaults Bug 1734750 - Stop force-disabling the socket process for background tasks. r=nalexander 2021-10-08 23:45:49 +00:00
docs Bug 1732011 - Update backgroundtasks example to include EXPORTED_SYMBOLS r=nalexander DONTBUILD 2021-09-23 07:41:50 +00:00
tests Bug 1602940 - Automated replacements to use Services.uuid. r=Gijs,necko-reviewers,preferences-reviewers,kershaw 2021-09-06 09:53:52 +00:00
BackgroundTask_exception.jsm
BackgroundTask_failure.jsm
BackgroundTask_success.jsm
BackgroundTasks.cpp
BackgroundTasks.h Bug 1716849: Add crash annotation for error when aborting for failed module import. r=mccr8 2021-07-22 16:58:02 +00:00
BackgroundTasksManager.jsm
BackgroundTasksTestUtils.jsm
BackgroundTasksUtils.jsm
components.conf
moz.build
nsIBackgroundTasks.idl
nsIBackgroundTasksManager.idl