[socket-process] nsIPrefService.resetPrefs does not work
Categories
(Core :: Networking, defect, P2)
Tracking
()
People
(Reporter: dragana, Assigned: CuveeHsu)
References
(Blocks 1 open bug)
Details
(Whiteboard: [necko-triaged])
Reporter | ||
Comment 1•6 years ago
|
||
Reporter | ||
Comment 2•6 years ago
|
||
we can also turn off the socket process for this tests.
Comment 3•6 years ago
|
||
Sorry for the delay.
(In reply to Dragana Damjanovic [:dragana] from comment #1)
Can you give me a short explanation what needs to be done here to make
resetPrefs work with the Socket process that will use gSharedMap.
This is much easier said than done.
So, to be clear, this would not have correctly after child process startup even before shared preferences existed. It would have caused the preferences in the parent process to be reset, but not child processes, which means that parent and child processes would quickly become out of sync.
With shared preferences, the situation becomes a bit harder. There are some ways we could handle this, with varying degrees of brokenness, but all of them require leaking the shared map memory, since any string references which come from it are treated as permanent literals, and are not refcounted.
(In reply to Dragana Damjanovic [:dragana] from comment #2)
we can also turn off the socket process for this tests.
That's probably the best option. Any attempt to support resetting the pref service in a multi-process world is going to require a nontrivial amount of intricate code. And this function is only used by a few highly specific pref service unit tests, and should never be used elsewhere. Since those tests don't depend on the socket process at all (and don't even use the network), there's really no reason we should spend effort trying to make the socket process work with them.
Reporter | ||
Comment 4•6 years ago
|
||
(In reply to Kris Maglione [:kmag] from comment #3)
Sorry for the delay.
(In reply to Dragana Damjanovic [:dragana] from comment #1)
Can you give me a short explanation what needs to be done here to make
resetPrefs work with the Socket process that will use gSharedMap.This is much easier said than done.
So, to be clear, this would not have correctly after child process startup even before shared preferences existed. It would have caused the preferences in the parent process to be reset, but not child processes, which means that parent and child processes would quickly become out of sync.
With shared preferences, the situation becomes a bit harder. There are some ways we could handle this, with varying degrees of brokenness, but all of them require leaking the shared map memory, since any string references which come from it are treated as permanent literals, and are not refcounted.
(In reply to Dragana Damjanovic [:dragana] from comment #2)
we can also turn off the socket process for this tests.
That's probably the best option. Any attempt to support resetting the pref service in a multi-process world is going to require a nontrivial amount of intricate code. And this function is only used by a few highly specific pref service unit tests, and should never be used elsewhere. Since those tests don't depend on the socket process at all (and don't even use the network), there's really no reason we should spend effort trying to make the socket process work with them.
Thanks!!!
Updated•6 years ago
|
Reporter | ||
Updated•6 years ago
|
Updated•6 years ago
|
Comment 5•6 years ago
|
||
removed blocking on bug 1509472 based on my discussion with Dragana
Updated•6 years ago
|
Reporter | ||
Comment 6•6 years ago
|
||
Junior, can you take this one?
(I will forward you some pointers per email)
Comment 8•6 years ago
|
||
Since this work is no longer a part of Project Fission, can we remove it from the meta bug?
https://bugzilla.mozilla.org/show_bug.cgi?id=1451850
Reporter | ||
Updated•6 years ago
|
Assignee | ||
Comment 10•5 years ago
|
||
Not sure why [1] can't get the pref set by test
Assignee | ||
Comment 11•5 years ago
|
||
Well, bug 1555792 disabled socket process for xpcshell tests
https://searchfox.org/mozilla-central/rev/9ae20497229225cb3fa729a787791f424ff8087b/netwerk/base/nsIOService.cpp#410
Assignee | ||
Comment 12•5 years ago
|
||
Description
•