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

Cluster mode broken on Node.js v7.0.0 #2466

Closed
targos opened this issue Oct 25, 2016 · 6 comments
Closed

Cluster mode broken on Node.js v7.0.0 #2466

targos opened this issue Oct 25, 2016 · 6 comments

Comments

@targos
Copy link
Contributor

targos commented Oct 25, 2016

Steps to reproduce

Try to run an app in cluster mode with pm2 start app.js -i 2

Software versions used

OS         : Linux x64
node.js    : https://nodejs.org/download/rc/v7.0.0-rc.2/
PM2        : 2.0.18

PM2 Log output

Use the command: tail --lines 50 ~/.pm2/pm2.log

2016-10-25 05:07:49: Starting execution sequence in -cluster mode- for app name:test id:2
events.js:319
        throw new TypeError('"listener" argument must be a function');
        ^

TypeError: "listener" argument must be a function
    at ChildProcess.removeListener (events.js:319:15)
    at workAround (/root/node/node-v7.0.0-rc.2-linux-x64/lib/node_modules/pm2/lib/God.js:128:20)
    at nodeApp (/root/node/node-v7.0.0-rc.2-linux-x64/lib/node_modules/pm2/lib/God.js:157:7)
    at Object.nodeApp (/root/node/node-v7.0.0-rc.2-linux-x64/lib/node_modules/pm2/lib/God/ClusterMode.js:103:12)
    at Object.executeApp (/root/node/node-v7.0.0-rc.2-linux-x64/lib/node_modules/pm2/lib/God.js:143:9)
    at ex (/root/node/node-v7.0.0-rc.2-linux-x64/lib/node_modules/pm2/lib/God.js:366:18)
    at prepare (/root/node/node-v7.0.0-rc.2-linux-x64/lib/node_modules/pm2/lib/God.js:372:7)
    at Server.onmessage (/root/node/node-v7.0.0-rc.2-linux-x64/lib/node_modules/pm2/node_modules/pm2-axon-rpc/lib/server.js:105:6)
    at emitTwo (events.js:106:13)
    at RepSocket.emit (events.js:191:7)
@vmarchaud
Copy link
Contributor

We will wait until the official release of v7.0.0 to fix bugs since they might be fixed inside node itself until the release.

@targos
Copy link
Contributor Author

targos commented Oct 25, 2016

The official release of v7.0.0 is happening today.

The workAround function now throws because of this change: nodejs/node@b7a8a69

@jasnell
Copy link

jasnell commented Oct 25, 2016

v7.0.0 is done. Just waiting on the website to refresh with the links. https://nodejs.org/download/release/latest-v7.x/

@Unitech
Copy link
Owner

Unitech commented Oct 25, 2016

Ok landed in master, waiting for travis test to pass. The cluster mode got fixed with v7. will be published on 2.0.19

@soyuka
Copy link
Collaborator

soyuka commented Oct 25, 2016

Actually we fixed the same change in our own code, now that it has been fixed by nodejs we just skip the workaround for node 7 :). Nice job @Unitech, thanks!

@Unitech
Copy link
Owner

Unitech commented Oct 25, 2016

pm2@2.0.19 with Node v7 fix published

There is also a deprecation warning message https://gist.github.com/Unitech/784ad1a6a85146a0330323bc108df581 will be fixed soon

Closing

@Unitech Unitech closed this as completed Oct 25, 2016
DiscipleD added a commit to DiscipleD/blog that referenced this issue Jan 29, 2017
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

5 participants