Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 1637027a628d69568719988dd89865f95b319135
      
https://github.com/WebKit/WebKit/commit/1637027a628d69568719988dd89865f95b319135
  Author: Lauro Moura <[email protected]>
  Date:   2026-09-29 (Tue, 29 Sep 2026)

  Changed paths:
    M Tools/Scripts/libraries/webkitcorepy/setup.py
    M Tools/Scripts/libraries/webkitcorepy/webkitcorepy/__init__.py
    M Tools/Scripts/libraries/webkitcorepy/webkitcorepy/file_lock.py

  Log Message:
  -----------
  [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):
* Tools/Scripts/libraries/webkitcorepy/setup.py:
* Tools/Scripts/libraries/webkitcorepy/webkitcorepy/__init__.py:

Canonical link: https://commits.webkit.org/322149@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to