-
Notifications
You must be signed in to change notification settings - Fork 42
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
Race condition in mtime-precision/probe
#103
Comments
The problem can appear though if trying to lock files on different fs with different precisions. Maybe that should be a separate issue though. |
Hello @julien-f, if I understood correctly, the precision can vary when locking different paths that are associated with different file systems, is that correct? In those situations, Object.defineProperty can throw or maybe a previous precision will be used which is wrong. I’m not sure if we can do much here. There are a few options:
|
Yep. IMHO, those duplicate calls to I see a possible alternative to your ideas: the precision could be cached per device ( |
Didn’t know about the device. It seems we can indeed use that. Are you open to do a PR? |
Two parallel calls,
cachedPrecision
is not defined in both, both will callutimes
thenstat
, andObject.defineProperty
will be called twice.This does not throw
TypeError: Cannot redefine property
because the new value to be defined is the existing value.The text was updated successfully, but these errors were encountered: