Repository navigation
Recursive fs.watch crashes on Linux when deleting files #52018
Copy link
Copy link
Closed
Labels
fsIssues and PRs related to file-system APIs and the fs module.Issues and PRs related to file-system APIs and the fs module.linuxIssues and PRs related to the Linux platform.Issues and PRs related to the Linux platform.
Description
Activity
- addedfsIssues and PRs related to file-system APIs and the fs module.Issues and PRs related to file-system APIs and the fs module.linuxIssues and PRs related to the Linux platform.Issues and PRs related to the Linux platform.
on Mar 11, 2024 I've been getting this same error when watching a /parent directory and deleting a subdirectory that contains files.
I believe #51406 introduced this behavior, the FSWatch emit callback try to acquire the stat of the deleted file
node/lib/internal/fs/recursive_watch.js
Line 160 in 1264414
const currentStats = statSync(file);
can you take a look? @mcollina- added a commit that references this issue
on Apr 3, 2024 Here is the fix #52349
- linked a pull request that will close this issuefs: fix ENOENT on file deletion #52571
on Apr 18, 2024 I have just being hit with this bug as well for node 20. Was the fix merged? And if not, what version will this fix be included?
- added a commit that references this issue
on Apr 19, 2024 - added a commit that references this issue
on Apr 29, 2024 @mcollina this is also a bug in v20.12, will this be backported to that or just for v22+?
it should be backported
Reacted by Zach, Timo Tijhof and Oliver Plummer- added 2 commits that reference this issue
on May 2, 2024
Metadata
Metadata
Assignees
Labels
fsIssues and PRs related to file-system APIs and the fs module.Issues and PRs related to file-system APIs and the fs module.linuxIssues and PRs related to the Linux platform.Issues and PRs related to the Linux platform.
Version
v21.7.0
Platform
Linux ARCH-FS 6.7.8-arch1-1 #1 SMP PREEMPT_DYNAMIC Sun, 03 Mar 2024 00:30:36 +0000 x86_64 GNU/Linux
Subsystem
fs
What steps will reproduce the bug?
Run the following code on Linux:
How often does it reproduce? Is there a required condition?
No response
What is the expected behavior? Why is that the expected behavior?
Emit a watcher event
What do you see instead?
Additional information
No response