FS: Transition to a robust object and actor lifecycle management
Categories
(Core :: DOM: File, task, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox106 | --- | fixed |
People
(Reporter: janv, Assigned: janv)
References
(Blocks 1 open bug)
Details
Attachments
(26 files)
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
Bug 1786465 - Create only one instance of FileSystemManagerChild per nsIGlobalObject; r=#dom-storage
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
Bug 1786465 - Make sure that gDataManagers is touched on the PBackground thread only; r=#dom-storage
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review |
The current lifecycle management is quite limited and doesn't provide a good way to handle the cases when a window/worker is dying or entire app is shutting down. The goal of this bug is to replace FileSystemActorHolder
with a dedicated object FileSystemManager
held by StorageManager
. The child actor will be created only once per StorageManager
which is effectively once per nsIGlobalObject
.
Assignee | ||
Comment 1•2 years ago
|
||
This patch also splits the creation of the top level protocol and getting the
root handle into separate logical steps.
Assignee | ||
Comment 2•2 years ago
|
||
Depends on D155351
Assignee | ||
Comment 3•2 years ago
|
||
PBackgroundFileSystem currently contains only one async message and we don't
plan to add more messages, so the one and only message can be defined directly
on PBackground.
Depends on D155366
Assignee | ||
Comment 4•2 years ago
|
||
The child actor will be held by FileSystemManager on the child side and the
parent actor already holds FileSystemDataManager, so it makes sense to rename
the protocol to PFileSystemManager.
Depends on D155367
Assignee | ||
Comment 5•2 years ago
|
||
This is the main lifecycle change. FileSystemHandle
now holds
FileSystemManager
object instead of holding FileSystemActorHolder
object.
There's only one instance of FileSystemManager
per StorageManager
(which is
created only once for nsIGlobalObject). FileSystemActorHolder
objects were
created for every StorageManager::GetDirectory call.
Depends on D155374
Assignee | ||
Comment 6•2 years ago
|
||
Depends on D155381
Assignee | ||
Comment 7•2 years ago
|
||
Depends on D155382
Assignee | ||
Comment 8•2 years ago
|
||
This will become useful when FileSystemManager gets an invalidated during
origin clearing. In that case, we need to throw away existing FileSystemManager
and create it again later.
Depends on D155383
Assignee | ||
Comment 9•2 years ago
|
||
Depends on D155384
Assignee | ||
Comment 10•2 years ago
|
||
Depends on D155550
Assignee | ||
Comment 11•2 years ago
|
||
Depends on D155551
Assignee | ||
Comment 12•2 years ago
|
||
Depends on D155552
Assignee | ||
Comment 13•2 years ago
|
||
After this change, we will create only one task queue per origin.
Depends on D155553
Assignee | ||
Comment 14•2 years ago
|
||
The message has no use in top level protocols.
Depends on D155554
Assignee | ||
Comment 15•2 years ago
|
||
This patch mostly removes:
- some unused lambda captures
- redundant variables like
pbackground
- named lambda functions which are used only once
- obsolete comments
Depends on D155555
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Comment 16•2 years ago
|
||
See the documentation in FileSystemHelpers.h
Depends on D155556
Assignee | ||
Comment 17•2 years ago
|
||
FileSystemDataManager can be now closed when it's still alive.
Depends on D155785
Assignee | ||
Comment 18•2 years ago
|
||
Depends on D155786
Assignee | ||
Comment 19•2 years ago
|
||
Depends on D155787
Assignee | ||
Comment 20•2 years ago
|
||
Depends on D155788
Assignee | ||
Comment 21•2 years ago
|
||
Depends on D155789
Updated•2 years ago
|
Comment 22•2 years ago
|
||
Assignee | ||
Comment 23•2 years ago
|
||
The send methods which need to be mocked in tests are declared in
OriginPrivateFileSystemChild the same way as POriginPrivateFileSystemChild send
methods, just without the Msg suffix and virtual. The relevant
POriginPrivateFileSystemChild send methods are hidden in
OriginPrivateFileSystemChild, so they can only be used internally for the
forwarding.
Comment 24•2 years ago
|
||
bugherder |
Assignee | ||
Comment 25•2 years ago
|
||
Assignee | ||
Comment 26•2 years ago
|
||
Depends on D156060
Assignee | ||
Comment 27•2 years ago
|
||
Depends on D156061
Comment 28•2 years ago
|
||
Assignee | ||
Comment 29•2 years ago
|
||
Comment 30•2 years ago
|
||
Comment 31•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/16b9fd20cbf4
https://hg.mozilla.org/mozilla-central/rev/3b0da4b4bb83
https://hg.mozilla.org/mozilla-central/rev/e4b3f3d8ba5f
https://hg.mozilla.org/mozilla-central/rev/031dd102befc
https://hg.mozilla.org/mozilla-central/rev/ede256a0c761
https://hg.mozilla.org/mozilla-central/rev/4eff22f565cc
https://hg.mozilla.org/mozilla-central/rev/f62bd47cabd3
https://hg.mozilla.org/mozilla-central/rev/399dce373c59
https://hg.mozilla.org/mozilla-central/rev/37b7616c8b42
https://hg.mozilla.org/mozilla-central/rev/a2f6102fc8ea
https://hg.mozilla.org/mozilla-central/rev/cfa7bbd206c3
https://hg.mozilla.org/mozilla-central/rev/256aef51d87b
https://hg.mozilla.org/mozilla-central/rev/224c332142d0
https://hg.mozilla.org/mozilla-central/rev/c3840fd37212
https://hg.mozilla.org/mozilla-central/rev/04e60585a3f0
https://hg.mozilla.org/mozilla-central/rev/0256861a7ac5
https://hg.mozilla.org/mozilla-central/rev/6d1f25188b13
https://hg.mozilla.org/mozilla-central/rev/3b39bc9214e6
https://hg.mozilla.org/mozilla-central/rev/fbc09d7df86e
https://hg.mozilla.org/mozilla-central/rev/0cc0844f049a
https://hg.mozilla.org/mozilla-central/rev/14b0be678d8c
Comment 32•2 years ago
|
||
Comment 33•2 years ago
|
||
Backed out along with Bug 1788182, Bug 1788178 for causing bustage on TestFileSystemDataManager.cpp
- backout: https://hg.mozilla.org/integration/autoland/rev/a2b735d7c83a08d0da187bd76e4d6744d5ce5a19
- push: https://treeherder.mozilla.org/jobs?repo=autoland&revision=f47b9b43da3c5ad9f4fe34a767c77c8c583232e7&selectedTaskRun=ZxL25bweQVCADtTycQZiyw.1
- failure log: https://treeherder.mozilla.org/logviewer?job_id=389076423&repo=autoland&lineNumber=9558
[task 2022-08-31T23:02:02.399Z] 23:02:02 INFO - In file included from Unified_cpp_parent_datamodel0.cpp:2:0:
[task 2022-08-31T23:02:02.399Z] 23:02:02 INFO - /builds/worker/checkouts/gecko/dom/fs/test/gtest/parent/datamodel/TestFileSystemDataManager.cpp: In static member function 'static void mozilla::dom::fs::test::TestFileSystemDataManager::SetUpTestCase()':
[task 2022-08-31T23:02:02.399Z] 23:02:02 ERROR - /builds/worker/checkouts/gecko/dom/fs/test/gtest/parent/datamodel/TestFileSystemDataManager.cpp:85:34: error: 'mozilla::dom::fs::test::TestFileSystemDataManager::SetUpTestCase()::<lambda()>' has a field 'mozilla::dom::fs::test::TestFileSystemDataManager::SetUpTestCase()::<lambda()>::<resolver capture>' whose type uses the anonymous namespace [-Werror=subobject-linkage]
[task 2022-08-31T23:02:02.400Z] 23:02:02 INFO - [&resolver]() { return resolver->Done(); });
[task 2022-08-31T23:02:02.400Z] 23:02:02 INFO - ^
[task 2022-08-31T23:02:02.400Z] 23:02:02 INFO - cc1plus: all warnings being treated as errors
[task 2022-08-31T23:02:02.400Z] 23:02:02 ERROR - gmake[4]: *** [/builds/worker/checkouts/gecko/config/rules.mk:669: Unified_cpp_parent_datamodel0.o] Error 1
[task 2022-08-31T23:02:02.400Z] 23:02:02 INFO - gmake[4]: Leaving directory '/builds/worker/workspace/obj-build/dom/fs/test/gtest/parent/datamodel'
[task 2022-08-31T23:02:02.401Z] 23:02:02 ERROR - gmake[3]: *** [/builds/worker/checkouts/gecko/config/recurse.mk:72: dom/fs/test/gtest/parent/datamodel/target-objects] Error 2
[task 2022-08-31T23:02:02.401Z] 23:02:02 INFO - gmake[3]: *** Waiting for unfinished jobs....
Comment 34•2 years ago
|
||
Assignee | ||
Updated•2 years ago
|
Comment 35•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/55d79c50ca2f
https://hg.mozilla.org/mozilla-central/rev/5767c2e6ca26
Updated•2 years ago
|
Assignee | ||
Comment 36•2 years ago
|
||
Comment 37•2 years ago
|
||
A patch has been attached on this bug, which was already closed. Filing a separate bug will ensure better tracking. If this was not by mistake and further action is needed, please alert the appropriate party. (Or: if the patch doesn't change behavior -- e.g. landing a test case, or fixing a typo -- then feel free to disregard this message)
Comment 38•2 years ago
|
||
Comment 39•2 years ago
|
||
Backed out for causing multiple lint failures
Backout link: https://hg.mozilla.org/integration/autoland/rev/292d43f4f4d259a83975b0a6ea2ffee2f473b5e2
Comment 40•2 years ago
|
||
Comment 41•2 years ago
|
||
Backed out for causing wpt failures . CLOSED TREE
Backout link
Push with failures
Link to failure log 1
Link to failure log 2
Failure line 1 : TEST-UNEXPECTED-FAIL | /fs/FileSystemDirectoryHandle-removeEntry.https.any.worker.html | removeEntry() while the file has an open writable fails - promise_test: Unhandled rejection with value: object "TypeError: navigator.storage.getDirectory is not a function"
Failure line 2 : TEST-UNEXPECTED-FAIL | /fs/FileSystemDirectoryHandle-removeEntry.https.any.html | removeEntry() while the file has an open writable fails - promise_test: Unhandled rejection with value: object "TypeError: navigator.storage.getDirectory is not a function"
Comment 42•2 years ago
|
||
Comment 43•2 years ago
|
||
Comment 44•2 years ago
|
||
Comment 45•2 years ago
|
||
bugherder |
Updated•2 years ago
|
Assignee | ||
Comment 46•2 years ago
|
||
Multiple patches were landing at once, it seems there were no problems with patches for this bug.
Anyway, the patch stack landed successfully in the end.
Description
•