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

Better Master Process Exit Handling #4

Merged
merged 3 commits into from Apr 17, 2015
Merged

Better Master Process Exit Handling #4

merged 3 commits into from Apr 17, 2015

Conversation

rsandor
Copy link
Contributor

@rsandor rsandor commented Apr 16, 2015

This adds a new option named beforeExit to the ClusterManager constructor. This method will be executed before the master process is forcibly exited. Additionally, the manager will automatically exit if all of the worker processes die.

Ryan Sandor Richards added 2 commits April 10, 2015 12:39
* The `beforeExit` callback is always executed before the master process exits
  for any reason.
* Master process now explicitly exits if all the workers have died.
@rsandor
Copy link
Contributor Author

rsandor commented Apr 16, 2015

I am not sure why that 1.0.0 commit is there :/ probably screwed something up when I published the version 👎

* @param {Error} [err] Error that caused the master process to exit.
*/
ClusterManager.prototype._exitMaster = function (err) {
this.options.beforeExit(err);
Copy link
Member

Choose a reason for hiding this comment

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

should this take a cb? otherwise we might exit if the beforeExit function is async

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's a good point, on it!

@bkendall
Copy link
Contributor

that 1.0.0 commit continues to haunt you haha

rsandor added a commit that referenced this pull request Apr 17, 2015
Better Master Process Exit Handling
@rsandor rsandor merged commit 8b135ea into master Apr 17, 2015
@rsandor rsandor deleted the rsandor/exit branch April 17, 2015 20:00
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

Successfully merging this pull request may close these issues.

None yet

3 participants