-
-
Notifications
You must be signed in to change notification settings - Fork 9.2k
Fix webpack hanging under certain circumstance, use process.exitCode instead of process.exit in compilerCallback #6193
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
Conversation
|
@crvv is this still supported for node 6, 8? You mention 9 in your document. |
|
Those words was added in Node.js 6.0 document. https://nodejs.org/dist/latest-v6.x/docs/api/process.html#process_process_exit_code |
|
Thank you for your pull request! The most important CI builds succeeded, we’ll review the pull request soon. |
|
@TheLarkInn According to the docs, |
|
It looks like this Pull Request doesn't include enough test cases (based on Code Coverage analysis of the PR diff). A PR need to be covered by tests if you add a new feature (we want to make sure that your feature is working) or if you fix a bug (we want to make sure that we don't run into a regression in future). @crvv Please check if this is appliable to your PR and if you can add more test cases. Read the test readme for details how to write test cases. |
|
Hi @crvv. Just a little hint from a friendly bot about the best practice when submitting pull requests:
You don't have to change it for this PR, just make sure to follow this hint the next time you submit a PR. |
|
Thanks |
What kind of change does this PR introduce?
bugfix
Did you add tests for your changes?
No. It's hard to write test and maybe it is not necessary.
Summary
https://nodejs.org/dist/latest-v9.x/docs/api/process.html#process_process_exit_code
The issue is that Node.js doesn't exit itself after the
process.exit(1)in line 367 ofwebpack.js.Some callbacks of
fs.statandfs.readFilewere never called at this time.I am not familiar with Node.js and libuv. The following is my guess.
webpackcallsfsfunctions many times, and they will use the thread pool of libuv.node-sasswill use the same thread pool to do its work.After the call to
process.exit(), thefsfunctions will fail silently and won't release their threads, butnode-sassis waiting for threads andprocess.exit()is waiting fornode-sass.Does this PR introduce a breaking change?
No.