Branch: refs/heads/webkitglib/2.52
Home: https://github.com/WebKit/WebKit
Commit: de490b43cadd97cdf5d5c7edaa9963e5e7b81fd5
https://github.com/WebKit/WebKit/commit/de490b43cadd97cdf5d5c7edaa9963e5e7b81fd5
Author: Lauro Moura <[email protected]>
Date: 2026-10-03 (Sat, 03 Oct 2026)
Changed paths:
M Tools/Scripts/libraries/webkitcorepy/webkitcorepy/file_lock.py
Log Message:
-----------
Cherry-pick 322149@main (1637027a628d).
https://bugs.webkit.org/show_bug.cgi?id=325092
[webkitcorepy] FileLock race can trigger FileNotFoundError checking for
stale locks
https://bugs.webkit.org/show_bug.cgi?id=325092
Reviewed by Jonathan Bedard and Sam Sneddon.
264321@main moved Unix ports from using fcntl.flock to os.O_EXLOCK, also
adding a fallback method with os utilities when os.O_EXLOCK is not
available (e.g. Linux). While it worked fine most of the time, under
some constraints this fallback method can trigger some race conditions,
like files disappearing between checking their existence and actually
opening them (e.g. triggering FileNotFoundError when checking for stale
lock files).
So this commit adds back the fcntl.flock method as an alternative for unix
systems when os.O_EXLOCK is not available, while still keeping the current
fallback in place.
* Tools/Scripts/libraries/webkitcorepy/webkitcorepy/file_lock.py:
(FileLock.acquire):
(FileLock):
(FileLock.release):
Canonical link: https://commits.webkit.org/322149@main
Canonical link: https://commits.webkit.org/305877.1187@webkitglib/2.52
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications