You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In some configurations it is possible for chokidar to end up watching the entire C:/ drive on windows machines. This in turn leads exceptions being thrown due to locked files being read.
See the following reproduction repo https://github.com/filimon-danopoulos-stratsys/wireit-watch-issue for steps to reproduce. Note that the reproduction it is not 100% reliable, sometimes it takes a while for the condition to show.
The text was updated successfully, but these errors were encountered:
…time of analysis (#628)
### Background
We automatically add `package-lock.json` (or equivalent depending on the package manager) entries to the `files` of every script during analysis. We do this so that updates to dependencies invalidate the fingerprint and trigger re-runs.
However, previously we added all *potential* `package-lock.json` paths to the `files` array, whether or not they exist. Meaning for a script defined in `/foo/bar/package.json` we would add:
- `/foo/bar/package-lock.json`
- `/foo/package-lock.json`
- `/package-lock.json`
This is technically correct, however the effect of this in watch mode is that we would register a chokidar watcher for all of those paths, which meant asking the OS to listen for any new file created in any of those directories (including the root directory).
It seems that on Windows, this will occasionally cause errors such as `EBUSY: resource busy or locked, lstat 'C:\DumpStack.log.tmp`. I'm a bit unclear as to why an `lstat` is being issued for a file in `C:\`, since it doesn't seem necessary to stat files that we aren't actually interested in -- but that is what happens through chokidar for some reason.
### This PR
We now only add `package-lock.json` files to the `files` array to a script if the `package-lock.json` exists at the time of analysis. This does mean that a new watch iteration won't occur if a new `package-lock.json` is created during a watch session, but that's really not very important, and not worth the cost/bugs associated with always watching all parent directory listings for all scripts.
Fixes#606
In some configurations it is possible for chokidar to end up watching the entire C:/ drive on windows machines. This in turn leads exceptions being thrown due to locked files being read.
See the following reproduction repo https://github.com/filimon-danopoulos-stratsys/wireit-watch-issue for steps to reproduce. Note that the reproduction it is not 100% reliable, sometimes it takes a while for the condition to show.
The text was updated successfully, but these errors were encountered: