Skip to content
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

http server doesn't shut down with Ctrl-C in Windows Git Bash #1041

Closed
akatechis opened this issue Aug 14, 2017 · 6 comments
Closed

http server doesn't shut down with Ctrl-C in Windows Git Bash #1041

akatechis opened this issue Aug 14, 2017 · 6 comments

Comments

@akatechis
Copy link

Do you want to request a feature or report a bug?
bug report

What is the current behavior?
I am running webpack-dev-server command to serve up a simple app. I'm launching it via Git Bash on Windows (not sure if this is relevant). When I press Ctrl-C to stop it, and relaunch it, I get the following:

> webpack-dev-server --colors

events.js:182
      throw er; // Unhandled 'error' event
      ^

Error: listen EADDRINUSE 127.0.0.1:9000
    at Object._errnoException (util.js:1022:11)
    at _exceptionWithHostPort (util.js:1045:20)
    at Server.setupListenHandle [as _listen2] (net.js:1330:14)
    at listenInCluster (net.js:1378:12)
    at GetAddrInfoReqWrap.doListen [as callback] (net.js:1504:7)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:100:10)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! pefin-web-ui@1.0.0 start: `webpack-dev-server --colors`
npm ERR! Exit status 1
npm ERR!

If the current behavior is a bug, please provide the steps to reproduce.

  1. Launch webpack-dev-server
  2. Ctrl-C to kill the process
  3. Launch again.
  4. Address in use suggests the first http server was not properly shut down.

(Willing to concede it might be related to git bash/windows signals?)

What is the expected behavior?
The second process should launch normally

Please mention your webpack and Operating System version.
webpack: 2.6.1
webpack-dev-server: 2.7.1
Windows 10 Home (Version 1703)

@shellscape
Copy link
Contributor

Chalking this up to an edge case with bash on Windows. It definitely doesn't happen in bash proper. Would be happy to review a pull request if you'd like to submit one.

@akatechis
Copy link
Author

akatechis commented Aug 14, 2017

Im particularly suspicious of Git Bash (Msys2 terminal) itself, since I started seeing this behavior ever since upgrading git to 2.14.1 a few days ago.

@raycashmore
Copy link

Same here with 2.14.1. Probably related to git-for-windows/git#1248

@shellscape
Copy link
Contributor

I don't have a windows machine available to debug this, so we're going to have to rely on someone in the community to debug why SIGINT doesn't work in that environment. We'll leave this one open for a while in the hopes that someone steps up.

@shellscape
Copy link
Contributor

We're going to close this one citing lack of activity and git-for-windows/git#1248. Please do ping me if someone discovers info that webpack-dev-server is doing something wrong with capturing SIGINT on that particular platform and app.

@lzl124631x
Copy link

lzl124631x commented Dec 16, 2017

I'm still facing this issue with webpack-dev-server version 2.9.7 using Git Bash for Windows (which caused another issue and wasted my time). But it works fine with CMD.

Recently nodemon fixed a similar issue by using fork instead of spawn. I'm not sure if this issue can be solved using the same method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants