Skip to content

Commit

Permalink
use preventDefault instead of exit() in cli()
Browse files Browse the repository at this point in the history
  • Loading branch information
tj committed Aug 19, 2011
1 parent 7f09b94 commit 6cfd9e3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/plugins/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ exports = module.exports = function(){
command = commands[i];
if (~command.flags.indexOf(arg)) {
command.callback(master);
process.exit(0);
master.preventDefault = true;
}
}
}
Expand Down

4 comments on commit 6cfd9e3

@evocateur
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this change, whenever I invoke a cli command, e.g., node server.js stop, it just hangs there after executing until I hit ^C. This is less than optimal. What was the motivation for this behaviour change?

@tj
Copy link
Contributor Author

@tj tj commented on 6cfd9e3 Aug 31, 2011

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it will hang if you have connections etc active in the master process, which is probably what's going on

@evocateur
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll try reducing it into a simple test case, but it's basically a simple Express app based on rgrove's combohandler. It's quite likely a file handle or something is lingering, since it is fairly basic and doesn't really listen for any cluster events (I hacked a local copy to use cluster instead of spark2).

Thanks for the swift response.

@tj
Copy link
Contributor Author

@tj tj commented on 6cfd9e3 Aug 31, 2011

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the main problem is when you do cluster(server) you usually require() in an app with a lot of connections etc. I should have been more verbose with this commit message, I forget exactly what it was messing with but the hard exit was causing some issues

Please sign in to comment.