Skip to content

fs: handle recursive watch setup races - #65699

Open
panva wants to merge 2 commits into
nodejs:mainfrom
panva:fix-recursive-watch-aix-enodev
Open

fs: handle recursive watch setup races#65699
panva wants to merge 2 commits 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 65.21739% with 24 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.06%. Comparing base (f9ab994) to head (a075c13).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
lib/internal/fs/recursive_watch.js 65.21% 21 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #65699      +/-   ##
==========================================
- Coverage   90.07%   90.06%   -0.02%     
==========================================
  Files         754      754              
  Lines      256395   256444      +49     
  Branches    48494    48516      +22     
==========================================
+ Hits       230947   230963      +16     
- Misses      16563    16582      +19     
- Partials     8885     8899      +14     
Files with missing lines Coverage Δ
lib/internal/fs/recursive_watch.js 85.12% <65.21%> (-3.73%) ⬇️

... and 29 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
Comment thread test/parallel/test-fs-watch-recursive-setup-races.js Outdated
@panva panva removed the author ready PRs with CI started, the required approvals, and no outstanding review comments. label Sep 1, 2026
Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Assisted-by: Codex

@lpinca lpinca left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RSLGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

5 participants