Move SessionStorage to parent process
Categories
(Core :: Storage: localStorage & sessionStorage, enhancement, P1)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox83 | --- | fixed |
People
(Reporter: neha, Assigned: tt)
References
(Blocks 2 open bugs)
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•10 months ago
|
Updated•10 months ago
|
Updated•10 months ago
|
Updated•10 months ago
|
| Assignee | ||
Comment 1•10 months ago
|
||
Take this from Eden since he is on PTO.
Comment 2•10 months ago
|
||
Comment 3•10 months ago
|
||
Depends on D87197
Comment 4•10 months ago
|
||
Depends on D87198
| Assignee | ||
Comment 5•10 months 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•10 months ago
|
||
The pref for testing SessionHistory in the parent process is fission.sessionHistoryInParent.
| Assignee | ||
Comment 7•10 months 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•10 months 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•10 months ago
|
||
It seems that it's related to/blocked bug 1572084
| Assignee | ||
Comment 10•10 months 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•9 months 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•9 months 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•9 months ago
|
| Assignee | ||
Comment 14•9 months 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 SessionStorageCaches. 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•9 months ago
|
||
| Assignee | ||
Comment 16•9 months ago
|
||
Depends on D89340
| Assignee | ||
Comment 17•9 months ago
|
||
Depends on D89341
| Assignee | ||
Comment 18•9 months 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•9 months ago
|
| Assignee | ||
Updated•9 months ago
|
| Assignee | ||
Updated•9 months ago
|
Comment 19•9 months 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•9 months 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
LSWriteOptimizerandLSValueto 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•9 months ago
|
||
I will update the comment in SessionStorageManager once the changes are finalized (the patches are reviewed)
Comment 22•9 months 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•9 months 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•9 months ago
|
||
Depends on D89342
| Assignee | ||
Comment 25•9 months ago
|
||
Updated•9 months ago
|
| Assignee | ||
Updated•9 months ago
|
Updated•9 months ago
|
Updated•9 months ago
|
Updated•9 months ago
|
Updated•9 months ago
|
Updated•9 months ago
|
Updated•9 months ago
|
Updated•9 months ago
|
Updated•8 months ago
|
Updated•8 months ago
|
Updated•8 months ago
|
Comment 26•8 months ago
|
||
Updated•8 months ago
|
Updated•8 months ago
|
| Assignee | ||
Comment 27•8 months ago
|
||
Updated•8 months ago
|
Updated•8 months ago
|
| Assignee | ||
Comment 28•8 months 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•8 months ago
|
||
Pushed by ttung@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/eccd53004a47 Sync SessionStorageCache to the parent process per write operation; r=dom-workers-and-storage-reviewers,janv https://hg.mozilla.org/integration/autoland/rev/e04b853cf5d2 Make SessionStorage sync less often by synchronizing SessionStorageCache at the next stable state; r=dom-workers-and-storage-reviewers,janv https://hg.mozilla.org/integration/autoland/rev/44541aaaa9f0 Use PBackground for syncing SessionStorageCache and use LSWriteOptimizer to send data changes; r=dom-workers-and-storage-reviewers,janv,nika
Comment 31•8 months 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
•