Fix unresolved promise when worker shuts down during copying
Categories
(Core :: DOM: File, defect, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox112 | --- | fixed |
People
(Reporter: jjalkanen, Assigned: jjalkanen)
References
(Blocks 1 open bug)
Details
Attachments
(1 file, 4 obsolete files)
In particular on the Macintosh platform, the xpcshell tests for the asynchronous copying method FileSystemWritableFileStream::Write in a worker may have shutdown hangs and/or crashes because a test failure cancels the copying task, and the cancel implementation of nsAsyncStreamCopier does not call the OnStopRequest of its task observer, which should resolve the pending DOM-promise.
Some ways to improve the situation would be to
- call OnStopRequest in nsAsyncStreamCopier's cancel method
- keep the worker alive with a strong reference until copying is finished
- ensure that the promise is not left in pending state when the observer is destroyed
Assignee | ||
Comment 1•2 years ago
|
||
Assignee | ||
Comment 2•2 years ago
|
||
Depends on D169602
Assignee | ||
Comment 3•2 years ago
|
||
For the record, the issue was discovered and investigated by :janv
Assignee | ||
Comment 4•2 years ago
|
||
Updated•2 years ago
|
Assignee | ||
Comment 5•2 years ago
|
||
Comment 6•2 years ago
|
||
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Comment 7•2 years ago
|
||
(In reply to Jari Jalkanen from comment #0)
In particular on the Macintosh platform, the xpcshell tests for the asynchronous copying method FileSystemWritableFileStream::Write in a worker may have shutdown hangs and/or crashes because a test failure cancels the copying task, and the cancel implementation of nsAsyncStreamCopier does not call the OnStopRequest of its task observer, which should resolve the pending DOM-promise.
Some ways to improve the situation would be to
- call OnStopRequest in nsAsyncStreamCopier's cancel method
- keep the worker alive with a strong reference until copying is finished
- ensure that the promise is not left in pending state when the observer is destroyed
or we can use NS_AsynCopy directly, the attached patch does exactly that
Comment 9•2 years ago
|
||
bugherder |
Description
•