Throw exceptions when attempting to instantiate remote settings client in any non-main/parent process
Categories
(Firefox :: Remote Settings Client, defect, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox110 | --- | fixed |
People
(Reporter: Gijs, Assigned: leplatrem)
References
Details
Attachments
(1 file)
We've had weird issues arise when people accidentally attempt to use RemoteSettings instances in child processes, the GPU process, or anywhere other than the main/parent process. We can't write to disk, we can be killed very easily, we can't rely on the same observer notifications - it's just painful through and through. If components need the information from remote settings in non-parent-process processes, they should do their own data sharing and updating etc. We should prevent this happening inside remote settings, though we may need to start by doing so on nightly only to avoid serious breakage.
Comment 1•1 year ago
|
||
The severity field is not set for this bug.
:leplatrem, could you have a look please?
For more information, please visit auto_nag documentation.
Assignee | ||
Comment 2•1 year ago
|
||
Gijs, do you have an example snippet that detects which process it runs in? Or do you know a component that does a similar check?
Reporter | ||
Comment 3•1 year ago
•
|
||
(In reply to Mathieu Leplatre [:leplatrem] from comment #2)
Gijs, do you have an example snippet that detects which process it runs in? Or do you know a component that does a similar check?
Sure, something like this should work, I think:
if (
Services.appinfo.processType !== Services.appinfo.PROCESS_TYPE_DEFAULT
) {
throw new Error("Can't do the thingummywhatsit");
}
(PROCESS_TYPE_DEFAULT
is the parent process - see https://searchfox.org/mozilla-central/rev/a0d4f8f112c5c792ae272bf6ce50763ddd23ffa2/xpcom/system/nsIXULRuntime.idl#216-229)
Does that help?
Assignee | ||
Comment 4•1 year ago
|
||
Updated•1 year ago
|
Pushed by mleplatre@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/ee59d072d5b5 Throw if Remote Settings client is instantiated in child process (r=Gijs)
Comment 6•1 year ago
|
||
bugherder |
Reporter | ||
Updated•1 year ago
|
Description
•