Move SessionStorage to parent process
Categories
(Core :: Storage: localStorage & sessionStorage, enhancement, P1)
Tracking
()
Tracking | Status | |
---|---|---|
firefox83 | --- | fixed |
People
(Reporter: neha, Assigned: tt)
References
(Blocks 1 open bug)
Details
Attachments
(4 files, 4 obsolete files)
The initial plan was to make SessionStorage persistent (bug 1445464) for Fission but because that seems to be blocked on QuotaManager v4, we could do an intermediate step of moving SessionStorage state in parent which can be fetched over IPC.
Reporter | ||
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Comment 2•4 years ago
|
||
Comment 3•4 years ago
|
||
Depends on D87197
Comment 4•4 years ago
|
||
Depends on D87198
Assignee | ||
Comment 5•4 years ago
•
|
||
Spoke to Eden and I put my understanding below:
The issue here is that SessionHistory is going to move to the parent process and we need to provide a way for SessionStore to collect on the parent process.
SessionRestore now collects SessionStorage data for documents on the content process through a docshell tree. However, when it comes to a cross-origin iframe/docshell, SessionRestore cannot find the cross-origin/cross-process SessionStorage data properly.
Assignee | ||
Comment 6•4 years ago
|
||
The pref for testing SessionHistory in the parent process is fission.sessionHistoryInParent
.
Assignee | ||
Comment 7•4 years ago
|
||
The remaining work here is to move the "collect" operation in SessionRestore to the parent process and check the failure tests on try.
Assignee | ||
Comment 8•4 years ago
|
||
try (without enabling the pref): https://treeherder.mozilla.org/#/jobs?repo=try&revision=10dade5427ae27833db3e638d30d2858e5f6a432
I will try to fix the existing test failures.
Then, polish patches.
Last, collect the SessionStroage on the parent process and push patches to try with enabling the pref.
Assignee | ||
Comment 9•4 years ago
|
||
It seems that it's related to/blocked bug 1572084
Assignee | ||
Comment 10•4 years ago
|
||
try with removing the code for deleting child actors from parent: https://treeherder.mozilla.org/#/jobs?repo=try&revision=0a96cce7d77e96b779d1291acfa0e24cbbec1e09&selectedTaskRun=fwqTMYtKRRe8zV0vAZnuCg.0
Assignee | ||
Comment 11•4 years ago
•
|
||
Have a meeting with Nika and Yaron today.
So, the main things that Nika was worried about actually are fixed by Yaron's previous work (https://bugzilla.mozilla.org/show_bug.cgi?id=1593246)
We still want to have a test to verify it and it should still be done in M6b.
The main work here that sync SessionStorage to the parent process for each operation or each a few seconds can be done in M6c rather than M6b
Assignee | ||
Comment 12•4 years ago
•
|
||
I have separated the work that should be done before M6b out to bug 1660485, so here is M6c.
And Yaron will work on it :)
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 14•4 years ago
•
|
||
I have a draft that sync SessionStorageCache
's write operations (SetItem
, RemoveItem
, and Clear
) to the parent process per stable state asynchronous. So that the parent process has copies of SessionStorageCache
s. It uses LSValue
, and LSWriteOptimizer
so that the size of IPC messages should be reduced.
I will update the patch once I polish the patch.
Assignee | ||
Comment 15•4 years ago
|
||
Assignee | ||
Comment 16•4 years ago
|
||
Depends on D89340
Assignee | ||
Comment 17•4 years ago
|
||
Depends on D89341
Assignee | ||
Comment 18•4 years ago
|
||
D87197, D87198, and D87199 can achieve moving SessioinStorage to the parent process. However, we can reduce the changes by reusing the current code for SessionStorage and reduce the size of IPC messages by LSValue
and LSWriteOptimizer
.
I'm going to abandon D87197, D87198, and D87199.
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Updated•4 years ago
|
Comment 19•4 years ago
|
||
Before we start reviewing the patches, could you provide a high level description of the approach ?
It doesn't have to be long, just a few sentences, like what top level protocol will be used for communication, what will be re-used from LSNG, etc.
Assignee | ||
Comment 20•4 years ago
|
||
(In reply to Jan Varga [:janv] from comment #19)
Before we start reviewing the patches, could you provide a high level description of the approach ?
It doesn't have to be long, just a few sentences, like what top level protocol will be used for communication, what will be re-used from LSNG, etc.
Sure!
Goal:
Move SessionStorage to parent process because SessionStore/SessionHistory will need to access SessionStorage data for any origin on the parent process during runtime.
What we have right now:
- All sessionStorage data is sent from a content process to the parent process when the content process is shutting down
- SessionStorage data is sent from the parent process to content when the corresponding content process is re-created
Changes here:
- D89340: SessionStorage data for an origin is sent from a content process to the parent process per write operation (
SetItem
,RemoveItem
, andClear
) - D89341: Similar to LSSnapshot, accumulate SessionStorage data for an origin and send them to the parent process in a stable state.
- D89342: Use
LSWriteOptimizer
andLSValue
to coalesce SessionStorage data. So that the IPC message size can be reduced.
Overall/after applying current changes:
- Once there is a write operation for SessionStorage, SessionStorage will accumulate the wirteInfos until the next stable state and then send them together to the parent process.
- While a current process is shutting down, SessionStorage doesn't need to send all its session storage to the parent process since we should have had a snapshot of SessionStorageCaches for the content process in the parent process.
what top level protocol will be used for communication
The IPC protocol is still the same. (PContent
).
However, the content of the IPC message sent from content process to the parent process is changed to SSWriteInfo
.
what will be re-used from LSNG
LSValue
, and LSWriteOptimizer
are re-used.
The concept of LSSnapshot
is re-used as well, but the functionalities are divided into SessionStorageSyncHelper
and SeesionStorageCache
.
Assignee | ||
Comment 21•4 years ago
|
||
I will update the comment in SessionStorageManager once the changes are finalized (the patches are reviewed)
Comment 22•4 years ago
|
||
So, it's almost like LSNG regarding communication between parent/child, except:
- PContent is used instead of PBackground
- All data is sent from parent to content at once (during process creation) instead of using a snapshot which would load data on demand.
I'll take a closer look, but it looks this could be a good compromise for now.
Assignee | ||
Comment 23•4 years ago
|
||
(In reply to Jan Varga [:janv] from comment #22)
So, it's almost like LSNG regarding communication between parent/child, except:
- PContent is used instead of PBackground
- All data is sent from parent to content at once (during process creation) instead of using a snapshot which would load data on demand.
I'll take a closer look, but it looks this could be a good compromise for now.
Right, and thank you!
Assignee | ||
Comment 24•4 years ago
|
||
Depends on D89342
Assignee | ||
Comment 25•4 years ago
|
||
Updated•4 years ago
|
Assignee | ||
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Comment 26•4 years ago
|
||
Updated•4 years ago
|
Updated•4 years ago
|
Assignee | ||
Comment 27•4 years ago
|
||
Updated•4 years ago
|
Updated•4 years ago
|
Assignee | ||
Comment 28•4 years ago
•
|
||
lastest try and it looks good: https://treeherder.mozilla.org/#/jobs?repo=try&revision=61c6b1c638fad3b1991327413fa0e7e39c94f03e
I will land the patches after getting r+ from all reviewers .
Comment 30•4 years ago
|
||
Comment 31•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/eccd53004a47
https://hg.mozilla.org/mozilla-central/rev/e04b853cf5d2
https://hg.mozilla.org/mozilla-central/rev/44541aaaa9f0
Description
•