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

Comments

Projects
None yet
4 participants
@akatechis

akatechis commented Aug 14, 2017

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

This comment has been minimized.

Contributor

shellscape commented Aug 14, 2017

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

This comment has been minimized.

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

This comment has been minimized.

raycashmore commented Aug 16, 2017

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

@shellscape

This comment has been minimized.

Contributor

shellscape commented Aug 16, 2017

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

This comment has been minimized.

Contributor

shellscape commented Aug 28, 2017

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.

@shellscape shellscape closed this Aug 28, 2017

@lzl124631x

This comment has been minimized.

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