Skip to content

fs: handle recursive watch setup races - #65699

Open
panva wants to merge 1 commit into
nodejs:mainfrom
panva:fix-recursive-watch-aix-enodev
Open

fs: handle recursive watch setup races#65699
panva wants to merge 1 commit into
nodejs:mainfrom
panva:fix-recursive-watch-aix-enodev

Conversation

@panva

@panva panva commented Sep 1, 2026

Copy link
Copy Markdown
Member

Arm directory watchers before reading entries to close the setup window. Discard stale watcher state when paths disappear so recreated paths can be watched again.

On AIX, treat ENODEV as missing only when stat confirms the path is gone. Preserve root throwIfNoEntry behavior and other watch errors.

Fixes: #65697

@nodejs-github-bot nodejs-github-bot added fs Issues and PRs related to file-system APIs and the fs module. needs-ci PRs that need a full CI run. labels Sep 1, 2026
@panva
panva requested a review from codebytere September 1, 2026 08:33
@panva
panva force-pushed the fix-recursive-watch-aix-enodev branch from 668c4de to bdb25e9 Compare September 1, 2026 08:39
@panva
panva marked this pull request as draft September 1, 2026 08:56
@aduh95

aduh95 commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Arm directory watchers before reading entries to close the setup
window. Discard stale watcher state when paths disappear so recreated
paths can be watched again.

On AIX, treat ENODEV as missing only when stat confirms the path is
gone. Preserve root throwIfNoEntry behavior and other watch errors.

Fixes: nodejs#65697

Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Assisted-by: Codex
@panva
panva force-pushed the fix-recursive-watch-aix-enodev branch from bdb25e9 to 67b5c41 Compare September 1, 2026 10:05
@panva
panva marked this pull request as ready for review September 1, 2026 10:10
@codecov

codecov Bot commented Sep 1, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 73.91304% with 18 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.07%. Comparing base (f9ab994) to head (67b5c41).

Files with missing lines Patch % Lines
lib/internal/fs/recursive_watch.js 73.91% 17 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #65699   +/-   ##
=======================================
  Coverage   90.07%   90.07%           
=======================================
  Files         754      754           
  Lines      256395   256444   +49     
  Branches    48494    48517   +23     
=======================================
+ Hits       230947   230993   +46     
- Misses      16563    16571    +8     
+ Partials     8885     8880    -5     
Files with missing lines Coverage Δ
lib/internal/fs/recursive_watch.js 87.17% <73.91%> (-1.68%) ⬇️

... and 25 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@panva panva added the author ready PRs with CI started, the required approvals, and no outstanding review comments. label Sep 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. fs Issues and PRs related to file-system APIs and the fs module. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fs-watch-recursive-delete-race consistently failing on AIX

4 participants