-
Notifications
You must be signed in to change notification settings - Fork 7
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
filelock fails to acquire lock in sub-process launched via callr? #32
Comments
With this script I see the expected behavior:
That is:
|
A lock is an external pointer, you cannot copy it to another process. A lock belongs to a process, in the first place. Locking in a sub-process does work of course, many filelock test cases are written that way, actually. What is the problem you want to solve? |
Sorry, this was my mistake 😞 . In this:
I thought the output here was from within the sub-process; that is, I thought the sub-process was reporting that the lock wasn't actually acquired. This makes it clear that everything is working as intended:
Ultimately, my goal here was to provide a user with some test code using the |
Did they? My understanding is that on recent Linux kernels they should. |
Evidently so, although in this case it was a user on macOS. We've seen issues with advisory file locks not working on some specific NFS instances either because they were too old or misconfigured in some way, though. |
Do you think it would be useful to detect when advisory locks are not working, and fall back to another mechanism? |
That could be useful. For what it's worth, In RStudio, we have a separate locking scheme that relies on the atomicity of |
Created on 2021-02-12 by the reprex package (v1.0.0)
Is this the expected behavior?
The text was updated successfully, but these errors were encountered: