-
Notifications
You must be signed in to change notification settings - Fork 373
[CLI] Move native file locking into workers #2997
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: php-wasm/node/testable-syscall-overrides
Are you sure you want to change the base?
[CLI] Move native file locking into workers #2997
Conversation
…Windows FileLockManager tests
|
We can do this with a FileLockManagerForPosix and a FileLockManagerForWindows and fall back to the FileLockManagerForNode if the native locking API is not available. I've working on the implementation for both. The main things that require care are:
For Posix, we can keep it fairly simple for fcntl() by keeping track of which files a process has locked via fcntl() and then unlocking the entire range via fcntl() when locks need to be released. For Windows, implementing fcntl() semantics is more complicated. We'll have to maintain a collection of which ranges are locked per file in order to be able to unlock those ranges. If a caller wants to unlock part of a range, we'll have to unlock the entire range and then obtain locks for the remaining portions of the original locked range. For shared locks, we can obtain the new ranges before releasing the original range, but for exclusive ranges, we'll have to release the original range before attempting to obtain locks on the remaining ranges. (According to a Google answer about whether Windows allows overlapping exclusive locks by the same process) The good news is that we are already tracking locked ranges in the FileLockManagerForNode. The work for the Windows locks shouldn't be that different. cc @adamziel |
60a6f0b to
6023b7d
Compare
…ire remaining range
|
I roughed out native FileLockManager's for POSIX and Windows, but they are yet untested. Tomorrow, I plan to start by adapting native locking tests and testing these new classes. |
Motivation for the change, related issues
In order to fix native file locking in Windows, we are moving native file locking into workers.
More details coming...
Implementation details
TBD
Testing Instructions (or ideally a Blueprint)
TBD