You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.
If you fs.watchFile(file,...) a newly created flie in the listener of a fs.watchFile on it's parent directory,
then delete that file without otherwise modifying it, then that delete will never be noticed.
This bug only strikes when you start watching a new file in response to it's creation (which you detected by watching it's directory). If the file already exists when you start node, (and you start watching it after traversing that directory) then it will be detected correctly.
the deletion can be detected by doing an fs.readdir,
and then comparing that list to what you though you had.
but there is probably a much better way to fix this bug.
The text was updated successfully, but these errors were encountered:
The sequential/test-regress-GH-4027 test is flaky with an increased
system load, failing when the watched file is unlinked before the
first state of the watched file is retrieved.
After increasing the delay before unlinking and calling setTimeout
after watchFile, the flakiness stopped reproducing.
PR-URL: nodejs/node#14010Fixes: nodejs/node#13800
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
If you
fs.watchFile(file,...)
a newly created flie in the listener of a fs.watchFile on it's parent directory,then delete that file without otherwise modifying it, then that delete will never be noticed.
Here is a script to reproduce:
https://gist.github.com/50ac9170e4615df2b644
first discovered this here
mikeal/watch#36
This bug only strikes when you start watching a new file in response to it's creation (which you detected by watching it's directory). If the file already exists when you start node, (and you start watching it after traversing that directory) then it will be detected correctly.
the deletion can be detected by doing an fs.readdir,
and then comparing that list to what you though you had.
but there is probably a much better way to fix this bug.
The text was updated successfully, but these errors were encountered: