webpack-cli
webpack-cli copied to clipboard
filesystem cache corruption on SIGINT
If webpack-cli is terminated by SIGINT while writing to the filesystem cache (e.g. in watch mode during an incremental rebuild of a project with large external source maps), the filesystem cache will be corrupted and must be erased before webpack will build again.
webpack-cli should hook SIGINT
and await a clean exit from compiler.close.
Note that the child processes spawned by e.g. fork-ts-checker-webpack-plugin
or thread-loader
will hear SIGINT from the parent process, so they'll need to be isolated by spawning the compiler into a detached child process.
/cc @webpack/cli-team should be easy, we should add listener before running webpack and run close
when SIGINT
happens
I will fix it.
It should be added here, right?
https://github.com/webpack/webpack-cli/blob/master/packages/webpack-cli/lib/webpack-cli.js#L2057
process.on("SIGINT", () => {
compiler.close();
});
Here https://github.com/webpack/webpack-cli/blob/master/packages/webpack-cli/lib/webpack-cli.js#L2122 and also here https://github.com/webpack/webpack-cli/blob/master/packages/webpack-cli/lib/webpack-cli.js#L2135
This issue had no activity for at least half a year.
It's subject to automatic issue closing if there is no activity in the next 15 days.
Don't lock
Issue was closed because of inactivity.
If you think this is still a valid issue, please file a new issue with additional information.
Sorry for long fix :disappointed: