Open jkylling opened 3 years ago
I tried the above docker script with existing project that was breaking on Jenkins and watches grows to 12052. Can also confirm this goes to 0 with useTypescriptIncrementalApi: false
This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.
Describe the bug
The
fork-ts-checker-webpack-plugin
used bywebpack
inreact-scripts
spawns a lot of inotify watches onyarn build
. This is similar to the issue described in https://github.com/facebook/create-react-app/issues/7612This causes instabilities and crashes in our jenkins ci kubernetes cluster running with the jenkins kubernetes plugin. Multiple jenkins pipelines can be allocated concurrently on the same kuberentes node. The pipelines which are allocated together with a create-react-app build frequently fail with error messages like
No space left on device
, orUser limit of inotify watches reached
, since running out of inotify watches trigger ENOSPC.Mitigating this by bumping the
fs.inotify.max_user_watches
in the host os is not an attractive option as it would require using a custom image or deploying a daemonset to set the limit. Increasing the limit might have unintended consequences as well, especially if too many builds using create-react-app run on the same node.Disabling
fork-ts-checker-webpack-plugin
oruseTypescriptIncrementalApi
in thefork-ts-checker-webpack-plugin
fixes the issue.Did you try recovering your dependencies?
This is from a fresh
npx create-react-app my-app --template typescript
in anode:12
container.Which terms did you search for in User Guide?
inotify watches, ci, incremental builds
Environment
Running in a
node:12
container:Steps to reproduce
Assuming that you have docker installed the following commands reproduces the problem in a
node:12
container. On a linux based os you can also reproduce the issue, by tracking the number of inotify watches using the script below. The commands sets up a cleannpx create-react-app my-app --template typescript
example app, and runsyarn build
while tracking the number of inotify watches. If you then apply the patch to disableuseTypescriptIncrementalApi
the number of watches stays at zero on the nextyarn build
I have verified that all the watches belong to the node process running the
fork-ts-checker-webpack-plugin
.Expected behavior
The number of inotify watches stays at 0 throughout the entire build.
Actual behavior
The number of inotify watches increases to 5497.
Reproducible demo
See steps to reproduce.
Possible solution
Add an option to turn off
fork-ts-checker-webpack-plugin
entirely , or disableuseTypescriptIncrementalApi
.would suffice.