Closed Bug 1862343 Opened 2 years ago Closed 2 years ago

[wpt-sync] Sync PR 42879 - FSA: Return LockHandle after eviction

Categories

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

task

Tracking

()

RESOLVED FIXED
122 Branch
Tracking Status
firefox122 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 42879 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/42879
Details from upstream follow.

Nathan Memmott <memmott@chromium.org> wrote:

FSA: Return LockHandle after eviction

This is the final changes needed to implement BFCache logic for the File
System Access API. This change makes it so that when we attempt to take
a Lock on file with an existing contentious Lock, we can evict the Lock
if it is held by only inactive pages, and return the new Lock after
eviction.

When we evict a Lock to take a new Lock, the new Lock is pending until
the evicting Lock has been evicted. The pending Lock is not given to the
TakeLock caller until it is no longer pending.

While it is pending though, it is still considered an active Lock, and
all further calls to TakeLock will assume it exists.

If we attempt to take a Lock that is a child of a pending Lock, then it
will also be pending and the caller will not receive the Lock until the
ancestor pending Lock's evicting Lock has been evicted.

If we attempt to take a Lock that is in contention with a pending Lock,
then we can also evict the pending Lock if it is held only by inactive
pages. The callers for the evicting pending Lock will never receive it.
And the new pending Lock waits for the eviction of the original evicting
Lock that the evicting pending Lock was waiting on.

If we evict a Lock that has multiple pending Lock children, then the new
Lock must wait for the eviction of all the child pending Locks' evicting
locks.

Bug: 1382215, 1241174
Change-Id: Iabd602a6ae37bfb69f10e13f08cfb3c1c77bdbd2
Reviewed-on: https://chromium-review.googlesource.com/4994423
WPT-Export-Revision: 821923f6abc683db2ee7d079dd265faae74e91fb

PR 42879 applied with additional changes from upstream: 0ca9cf2fa964d46ef48a33edc43bb94e00408e83
Component: web-platform-tests → DOM: File
Product: Testing → Core

CI Results

Ran 9 Firefox configurations based on mozilla-central, and Firefox, and Chrome on GitHub CI

Total 2 tests and 2 subtests

Status Summary

Firefox

OK : 2
PASS: 2
FAIL: 2

Chrome

OK : 2
PASS: 2
FAIL: 2

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

Pushed by wptsync@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/e7e4fa3aecc2 [wpt PR 42879] - FSA: Return LockHandle after eviction, a=testonly
Pushed by wptsync@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/2442476fbb58 [wpt PR 42879] - FSA: Return LockHandle after eviction, a=testonly
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 122 Branch
You need to log in before you can comment on or make changes to this bug.