-
Notifications
You must be signed in to change notification settings - Fork 60
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
initial server not closed #103
Comments
Hi @deg, Others have seen a similar issue where the server does not close (#97, #102). It seems like the primary reason people see this issue is because the child process does not respond to the termination command from node (or the command line). The current proposed solution is PR #99. It is interesting that you were able to solve this issue by replacing your initial task with just Would you mind giving some info on your setup? I'd like to know what version of
|
I’m happy to help, to the extent I can. Sadly, I don’t currently have a working case. To debug it, I had added a pile of console.log traces into my code. I pulled them out before I committed. (stupid of me… I’m usually fanatic about checkpointing every micro change, and I should have saved the exact working case). Anyway, it then stopped working in a different way ... the server dies very shortly after starting up. I lacked the tools and time to debug it so, for now, rolled back to my previous configuration … using nodemon on my dev server. Also, sadly, I can’t share my full project with you. It contains some proprietary code that I’m not allowed to release. That said, I’ll answer as much as I can, including your questions below. I’m running node 4.2.3. It’s running in a docker instance, hosted on a Mac running OX X 10.11.2 (El Capitan). I had been launcher the server with “nodemon -V -L vaServer.js”, and changed that to “grunt dev” Here’s the package.json (with a few bits elided). Note that some of the dependencies are not currently in use (e.g. the multiple doc packages): { |
Thank you, @deg! Will look further. |
This can happen if you are using babel-node to stat your server (via the cmd option).
See foreversd/forever#687 for reference. |
(alert: I'm new to grunt-express-server and many of the surrounding tools, so issue may be little more than my lack of understanding and/or out-of-date docs).
I started using grunt-express-server yesterday, replacing nodemon, because I wanted a toolchain where editing a source file would run my mocha tests and restart my dev server.
I discovered that, even though the tests ran and the server restarted; the server did not seem to be running my latest code. Much head-scratching later, I found that I had been bitten by two issues:
console.log and console.error messages were not appearing on my terminal, making it hard to see that the problem was that the new server instance had failed to fully start. Rather, it was dying because its port was in use. My guess is that this might be an artifact of the process dying without flushing console output. But, dunno. In any event, this is just a side-effect that made it harder to debug problem 2, the real issue.
My gruntfile was started with a task that did ['express:dev', 'watch]. Watch, in turn, listed express:dev as a task.
This did not work -- although I understood it to be what I should do, based on the docs I had read. When the node server was restarted, it did not kill the initial instance, so was not able to grab the port, so died. (and, making matters more confusing, was dying silently).
I fixed the problem by having my initial task just do ['watch'], and giving watch the option atBegin: true.
So, I think I'm ok now. Reporting this issue for the sake of improving docs for the next guy, or in the hope that I've revealed that I've done something stupid that I should fix.
The text was updated successfully, but these errors were encountered: