-
Notifications
You must be signed in to change notification settings - Fork 5
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
FI-2086: fix errors on webpack shutdown #389
Conversation
Codecov ReportPatch and project coverage have no change.
Additional details and impacted files@@ Coverage Diff @@
## main #389 +/- ##
=======================================
Coverage 76.95% 76.95%
=======================================
Files 213 213
Lines 10597 10597
Branches 978 978
=======================================
Hits 8155 8155
Misses 1873 1873
Partials 569 569
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
No issues running instructions in 2.1 -- running both with id still commented out and with it back in the code, neither ran into port issues! |
Having trouble running through the steps of 2.2, but I think it's unrelated. my npm install command has some output that, if I recall correctly, is different from the Mac outputs of the rest of the team. Pasting the output here
|
Confirming I have the same |
This is what I get when I get rid of
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is really great. I'm not able to duplicate the issue with webpack not exiting, but the fix seems ok.
I definitely want to get this in ASAP.
Because npm is not a process manager, it does not propagate SIGINTs to the scripts it starts (webpack in this case) - thus, doing Ctrl+C on the Foreman process will kill the npm process but not the webpack process. Replacing the "npm run start" command with whatever is listed under "start" in package.json bypasses this signal handling discrepancy.
ee9f04f
to
d1f71ea
Compare
Summary
Bug fix for FI-2086 webpack not shutting down correctly
This PR fixes two bugs related to shutdown of
inferno-core
:1. Hanging terminal on exit
inferno-core
README instructions for preliminary setupbin/inferno start
Ctrl+C
main.rb
. The originalsystem
method invokes a separate process to runforeman start
and waits for this new process to return, but it never does. Instead, theexec
method call replaces the current process and never returns by design - this is appropriate for our use cases since there is no further Ruby code that needs to be executed after theforeman start
command is launched.2. Webpack process is not shut down along with other processes
node
process running webpack is not also terminated. As a result, when inferno is restarted, it produces anEADDRINUSE
error for IP0.0.0.0
and port3000
. This error also occurs upon an automated restart when inferno is run with thewatch
flag set.inferno-core
README instructions for preliminary startupid
line indemo_suite.rb
is an easy option)bin/inferno start
- inferno will throw an error and exitEADDRINUSE
error and inferno will terminatewatch
flag set:bin/inferno start --watch
EADDRINUSE
error will be thrown and inferno will terminatewebpack
process can still be found running and needs to be manually terminatednpm start
not propagating signal interrupts to the process it launches (webpack
in our case). Here is a blog post about the issue in a different context.npm
process entirely by replacing the call tonpm run start
in theProcfile
with the command thatnpm start
would trigger inpackage.json
, which is thewebpack serve
invocation. This eliminates an unnecessary intermediary process and means signals to pass directly from theforeman
process to thenode
(webpack) process, allowing graceful shutdown.Testing Guidance
These solutions were developed and tested on a Mac OS and verified to also work on a Windows and Linux OS by Diego.