GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||
GeezerVison is showing github.com — fs: report errors from recursive watch events by codeNinja62 · Pull Request #66792 · nodejs/node ConversationFixes: #66791 On Linux, recursive
What this changes:
Why I didn't add a Tests (each one crashes the process without this change and passes with it):
Checked locally on a build of v24.22.0 has the same code, since #65486 landed there too, so this should go to v24.x as well. I used an AI coding assistant to help investigate this and draft the change. I reproduced the crashes myself, reviewed the diff, and ran the tests and lint locally.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsOn Linux, the recursive fs.watch() fallback resolves inotify events with stat() and lstat() calls, and arms fs.watch() on directories and symbolic links that appear later. Errors from those calls other than ENOENT were thrown from inside the FSEvent callback, where nothing can catch them, so the process exited: EACCES when a watched directory became unreadable, or when a new directory or the target of a new symbolic link was unreadable by the time it was handled; ELOOP for a symbolic link loop; and ENOTDIR when a watched directory was replaced by a file while events naming its entries were still queued. Report such errors through 'error', as #scanFolder() already does for readdir(), and take ENOTDIR from lstat() to mean that the entry is gone, as statSync() and #scanFolder() do. A directory or link that cannot be watched is dropped, so a later event about it picks it up again. Failures during the initial scan still propagate out of fs.watch(). Fixes: nodejs#66791 Signed-off-by: Sameer Ahmed <[email protected]>
Contributor
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
This was referenced
1 task
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ReviewersNo reviewsUh oh!
There was an error while loading. Please reload this page. AssigneesNo one assignedLabelsProjectsMilestoneNo milestoneDevelopmentSuccessfully merging this pull request may close these issues. fs.watch recursive crashes the process on Linux (uncaught EACCES) when a watched directory becomes unreadableUh oh!
There was an error while loading. Please reload this page. Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later. | |||||||||||||||||||||
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |