Closed Bug 1803062 Opened 1 year ago Closed 1 year ago

FS: SyncAccessHandle should do all IO off the worker thread

Categories

(Core :: DOM: File, task, P2)

task

Tracking

()

RESOLVED FIXED
110 Branch
Tracking Status
firefox110 --- fixed

People

(Reporter: janv, Assigned: janv)

References

Details

Attachments

(15 files, 1 obsolete file)

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 1789590 is going to use a sync IPC message for proxying QuotaObject::MaybeUpdateSize to the parent process (the sync IPC will eventually get eliminated in future). Doing sync IPC on the main thread or on the PBackground thread or a DOM worker thread is not desired so we need to move all IO off the worked thread. We already do reads and writes off the worker thread, but there are other methods which do IO directly on the worker thread, including the close operation.

The close operation is a bit tricky, because if we move the IO for it off the worker thread, close() can't be sync anymore and we need to prevent worker shutdown until close is actually finished using StrongWorkerRef.

Depends on D163939

This is needed to prevent build errors when AsyncCopy is called inside of a
lambda function.

Depends on D163941

Attachment #9306678 - Attachment description: WIP: Bug 1803062 - GetSerialEventTarget should return nested event target when a sync loop is running; r=#dom-workers → Bug 1803062 - GetSerialEventTarget should return nested event target when a sync loop is running; r=#dom-workers
Attachment #9306176 - Attachment description: WIP: Bug 1803062 - Switch from ordinary bool errors to nsresult errors in code for handling sync loops; r=#dom-workers → Bug 1803062 - Switch from ordinary bool errors to nsresult errors in code for handling sync loops; r=#dom-workers
Attachment #9306860 - Attachment is obsolete: true
Attachment #9306678 - Attachment description: Bug 1803062 - GetSerialEventTarget should return nested event target when a sync loop is running; r=#dom-workers → Bug 1803062 - GetSerialEventTarget should return the nested event target when a sync loop is running; r=#dom-workers
Attachment #9306179 - Attachment description: WIP: Bug 1803062 - Add a fallible way to create FileSystemSyncAccessHandle objects; r=#dom-storage → Bug 1803062 - Add a fallible way to create FileSystemSyncAccessHandle objects; r=#dom-storage
Attachment #9306180 - Attachment description: WIP: Bug 1803062 - Prevent worker shutdown until FileSystemSyncAccessHandles are closed; r=dom-storage → Bug 1803062 - Prevent worker shutdown until FileSystemSyncAccessHandles are closed; r=#dom-storage
Attachment #9307268 - Attachment description: WIP: Bug 1803062 - Bring back fallible Close; r=#dom-storage → Bug 1803062 - Bring back fallible Close; r=#dom-storage
Attachment #9306181 - Attachment description: WIP: Bug 1803062 - Don't call FileSystemSyncAccessHandle::Close when the object is already closed; r=#dom-storage → Bug 1803062 - Don't call FileSystemSyncAccessHandle::Close when the object is already closed; r=#dom-storage
Attachment #9306182 - Attachment description: WIP: Bug 1803062 - Prepare a way for using other FileSystemSyncAccessHandle states besides the open/closed state; r=#dom-storage → Bug 1803062 - Prepare a way for using other FileSystemSyncAccessHandle states besides the open/closed state; r=#dom-storage
Attachment #9306680 - Attachment description: WIP: Bug 1803062 - Change FileSystemSyncAccessHandle::Close to be async; r=#dom-storage → Bug 1803062 - Change FileSystemSyncAccessHandle::Close to be async; r=#dom-storage
Attachment #9306857 - Attachment description: WIP: Bug 1803062 - Create a task queue on top of the STS for each FileSystemSyncAccessHandle; r=#dom-storage → Bug 1803062 - Create a task queue on top of the STS for each FileSystemSyncAccessHandle; r=#dom-storage
Attachment #9306858 - Attachment description: WIP: Bug 1803062 - Add a helper class for automatic proxy releasing of objects; r=#dom-storage → Bug 1803062 - Add a helper class for automatic proxy releasing of objects; r=#dom-storage
Attachment #9306859 - Attachment description: WIP: Bug 1803062 - Read, write and close streams on the task queue; r=#dom-storage → Bug 1803062 - Read, write and close streams on the task queue; r=#dom-storage
Attachment #9306861 - Attachment description: WIP: Bug 1803062 - Truncate, GetSize and Flush on the task queue; r=#dom-storage → Bug 1803062 - Truncate, GetSize and Flush on the task queue; r=#dom-storage
Attachment #9306862 - Attachment description: WIP: Bug 1803062 - Change the complete callback of AsyncCopy to MoveOnlyFunction; r=#dom-storage → Bug 1803062 - Change the complete callback of AsyncCopy to MoveOnlyFunction; r=#dom-storage
Attachment #9306863 - Attachment description: WIP: Bug 1803062 - Use mStream in ReadOrWrite only on the task queue; r=#dom-storage → Bug 1803062 - Use mStream in ReadOrWrite only on the task queue; r=#dom-storage
Attachment #9306864 - Attachment description: WIP: Bug 1803062 - Deserialize streams only on the task queue; r=#dom-storage → Bug 1803062 - Deserialize streams only on the task queue; r=#dom-storage
Keywords: leave-open
Attachment #9307268 - Attachment description: Bug 1803062 - Bring back fallible Close; r=#dom-storage → Bug 1803062 - Expose the sync close operation using a dedicated method; r=#dom-storage
Pushed by jvarga@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/c8c20bcccd47
Switch from ordinary bool errors to nsresult errors in code for handling sync loops; r=dom-worker-reviewers,smaug
Pushed by jvarga@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/6499b9cc1cfc
GetSerialEventTarget should return the nested event target when a sync loop is running; r=asuth

Backed out for causing worker related failures.

Flags: needinfo?(jvarga)
Attachment #9306678 - Attachment description: Bug 1803062 - GetSerialEventTarget should return the nested event target when a sync loop is running; r=#dom-workers → Bug 1803062 - GetCurrentSerialEventTarget should return the nested event target when a sync loop is running; r=#dom-workers
Pushed by jvarga@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/d3b1d6fc7b15
GetCurrentSerialEventTarget should return the nested event target when a sync loop is running; r=asuth
Flags: needinfo?(jvarga)
Keywords: leave-open
Pushed by jvarga@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/1486ec3ed952
Add a fallible way to create FileSystemSyncAccessHandle objects; r=dom-storage-reviewers,jari
https://hg.mozilla.org/integration/autoland/rev/e34378476209
Prevent worker shutdown until FileSystemSyncAccessHandles are closed; r=dom-storage-reviewers,jesup
https://hg.mozilla.org/integration/autoland/rev/a784ec790ea5
Expose the sync close operation using a dedicated method; r=smaug
https://hg.mozilla.org/integration/autoland/rev/0ba70d490377
Don't call FileSystemSyncAccessHandle::Close when the object is already closed; r=dom-storage-reviewers,jesup
https://hg.mozilla.org/integration/autoland/rev/da468b3c44d0
Prepare a way for using other FileSystemSyncAccessHandle states besides the open/closed state; r=dom-storage-reviewers,jesup
https://hg.mozilla.org/integration/autoland/rev/4cec2499b6e9
Change FileSystemSyncAccessHandle::Close to be async; r=dom-storage-reviewers,jesup
https://hg.mozilla.org/integration/autoland/rev/e7809a501f21
Create a task queue on top of the STS for each FileSystemSyncAccessHandle; r=dom-storage-reviewers,jesup
https://hg.mozilla.org/integration/autoland/rev/08f90593777f
Add a helper class for automatic proxy releasing of objects; r=dom-storage-reviewers,jesup
https://hg.mozilla.org/integration/autoland/rev/8dbe876aeb90
Read, write and close streams on the task queue; r=dom-storage-reviewers,jesup
https://hg.mozilla.org/integration/autoland/rev/b0354e926ca9
Truncate, GetSize and Flush on the task queue; r=dom-storage-reviewers,jari
https://hg.mozilla.org/integration/autoland/rev/2165493fffb7
Change the complete callback of AsyncCopy to MoveOnlyFunction; r=dom-storage-reviewers,jesup
https://hg.mozilla.org/integration/autoland/rev/29757b4ea091
Use mStream in ReadOrWrite only on the task queue; r=dom-storage-reviewers,jari
https://hg.mozilla.org/integration/autoland/rev/020dd83e31e9
Deserialize streams only on the task queue; r=dom-storage-reviewers,jesup
No longer blocks: OPFS
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: