-
Notifications
You must be signed in to change notification settings - Fork 29.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fs,macos: fs.watch() behavior change in node >= 10.16.0 #29460
Comments
This commit introduces numerous regressions, see the Node.js container bug and the issues linked therein. I did not revert the changes to the test suite since those work okay with and without the reverted commit. I also had to roll back (parts of) the following commits: * 6602fca unix: fall back to kqueue on older macOS systems * 09ba477 bsd: plug uv_fs_event_start() error path fd leak This reverts commit 2d2af38. Fixes: nodejs/node#29460 Refs: libuv#2082
libuv/libuv#2452 - let's see how a revert is received. |
Goes back to just using it to watch folders, but keeps the other logic changes around. Refs: libuv#387 Refs: libuv#2082 Refs: libuv#1572 Refs: libuv#2452 Refs: nodejs/node#29460
@bnoordhuis @vtjnash Faced the same problem on our end when running with nodemon with Node.js 11.11 in production - Will be removing nodemon and running it with Node.js directly - Anyways, would be great to get an idea on the version of Node.js where this fix will be rolled out. Running it inside Docker in Amazon Linux 2 - Thus, would like to point out that this is not a MacOS specific issue as the label suggests. Thanks in advance. |
@tvvignesh Then your issue is something else. This issue is specifically about a macos-only change. |
Goes back to just using it to watch folders, but keeps the other logic changes around. Refs: libuv#387 Refs: libuv#2082 Refs: libuv#1572 Refs: libuv#2452 Refs: nodejs/node#29460
`fs.watch` does not consistently emit `'change'` events on Node 10.16.0, possibly due to nodejs/node#29460. `fs.watchFile` still works, but is less efficient, per the docs, so fall back to that only if necessary and also suggest that users run custody under an older version of Node. I explored several Node file-watching libraries (e.g. chokidar, sane) to try to find a more performant solution for Node 10.16.0 and it seems that they pretty much all fall back to `fs.watch` / `fs.watchFile`, unfortunately. sane offers the option to use watchman, but that requires installing a daemon so is a non-starter. Fixes #82. #83 tracks reverting this when the underlying Node issue has been fixed. Tested that log files update both when running custody under v8.9.3 and v10.16.0, and that `node-tail` only uses `fs.watchFile` in the latter.
Goes back to just using it to watch folders, but keeps the other logic changes around. Refs: #387 Refs: #2082 Refs: #1572 Refs: nodejs/node#29460 Fixes: #2488 Closes: #2452 PR-URL: #2459 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Saúl Ibarra Corretgé <[email protected]>
This reverts the patch from electron/node#100 which never got merged due to reasons outlined in libuv/libuv#2313 * Adds new patches that backports libuv/libuv#2459 and libuv/libuv#2460 Based on nodejs/node#29460
This reverts the patch from electron/node#100 which never got merged due to reasons outlined in libuv/libuv#2313 * Adds new patches that backports libuv/libuv#2459 and libuv/libuv#2460 Based on nodejs/node#29460
This reverts the patch from electron/node#100 which never got merged due to reasons outlined in libuv/libuv#2313 * Adds new patches that backports libuv/libuv#2459 and libuv/libuv#2460 Based on nodejs/node#29460
This reverts the patch from electron/node#100 which never got merged due to reasons outlined in libuv/libuv#2313 * Adds new patches that backports libuv/libuv#2459 and libuv/libuv#2460 Based on nodejs/node#29460
This reverts the patch from electron/node#100 which never got merged due to reasons outlined in libuv/libuv#2313 * Adds new patches that backports libuv/libuv#2459 and libuv/libuv#2460 Based on nodejs/node#29460
This reverts the patch from electron/node#100 which never got merged due to reasons outlined in libuv/libuv#2313 * Adds new patches that backports libuv/libuv#2459 and libuv/libuv#2460 Based on nodejs/node#29460
This reverts the patch from electron/node#100 which never got merged due to reasons outlined in libuv/libuv#2313 * Adds new patches that backports libuv/libuv#2459 and libuv/libuv#2460 Based on nodejs/node#29460
This reverts the patch from electron/node#100 which never got merged due to reasons outlined in libuv/libuv#2313 * Adds new patches that backports libuv/libuv#2459 and libuv/libuv#2460 Based on nodejs/node#29460
Based on your investigations, any suggested workarounds until a fix is released? |
The issue was fixed in libuv v1.33.0 and that was released as part of node v13.0.1 and v12.13.1. If you're on v10.x, you'll need to wait a little longer - no ETA. |
I have a project using webpack@4 watchers that uses watchpack -> chokidar -> fsevents. I recently upgraded from node v11.9.0 to v13.9.0. I am watching a lot of directories, because I have server-side and client-side HMR. Also, some packages in I get the error:
for node v13.9.0, but not v11.9.0. There are a few workarounds I've found.
|
For future readers of this thread, I think the message there is from interpreting an |
Since Node.js 10.x is no longer supported, and since this appears to be fixed in more recent versions, I'm closing this issue. We can revisit if it turns out that it is still an issue |
This is a container bug for issues caused by PR libuv/libuv#2082. Disparate reports but the root cause is the linked PR.
#25856
#27869
#28512
#28882
#28917
Fixing it turned out to be not so easy (libuv/libuv#2313) and simply reverting trades one regression for another.
The text was updated successfully, but these errors were encountered: