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

Fork mode by default for Node.js 0.10.x #684

Closed
Unitech opened this issue Sep 2, 2014 · 8 comments
Closed

Fork mode by default for Node.js 0.10.x #684

Unitech opened this issue Sep 2, 2014 · 8 comments

Comments

@Unitech
Copy link
Owner

Unitech commented Sep 2, 2014

Should PM2 start application in fork mode by default for Node.js 0.10.x ?

It would avoid some issues like:

@neonstalwart
Copy link

👍

1 similar comment
@soyuka
Copy link
Collaborator

soyuka commented Sep 3, 2014

👍

@rlidwka
Copy link
Collaborator

rlidwka commented Sep 3, 2014

It'll add a new issue:

  • a lot of confused users

If you are to make it default, it probably should be done for all node.js versions, not just 0.10.

@soyuka
Copy link
Collaborator

soyuka commented Sep 3, 2014

The fact is that 0.10 is not cluster friendly but 0.11 and so, 0.12 will be. It's sad not to use the cluster mode when it's totally safe to use it.

We could also mention in the README or with a pm2 warning that < 0.11 will be buggy by using cluster mode as it was in one of previous pm2 version.

@rlidwka
Copy link
Collaborator

rlidwka commented Sep 3, 2014

It's sad not to use the cluster mode when it's totally safe to use it.

It's never totally safe to use it.

Things like process.mainModule will surely make an impression that pm2 broke on update from node 0.10 to 0.11.

@Unitech
Copy link
Owner Author

Unitech commented Sep 4, 2014

I'm in to make the default exec mode to fork_mode for every node versions.
If there is the -i option then switch to cluster mode

@Unitech
Copy link
Owner Author

Unitech commented Sep 4, 2014

OK, now if you start an app the mode is fork_mode.
Otherwise if you start an app with the -i <instances> parameter it launches the app in cluster mode.

This is a big strategic change ! But will incur more stability for all Node.js version and less weird bugs.

The change is starting from the PM2 0.10.7 version.

Long live to PM2 !

@Unitech Unitech closed this as completed Sep 4, 2014
Unitech added a commit that referenced this issue Sep 16, 2014
@Unitech
Copy link
Owner Author

Unitech commented Sep 16, 2014

damned: a99bd4d#diff-11b18b3af4c330a60bff03e3abab63a6R199

Now script started with cluster mode are set a main script

  • process.mainModule is ok
  • module.parent is ok

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