Unitech / pm2

Node.js Production Process Manager with a built-in Load Balancer.
https://pm2.keymetrics.io/docs/usage/quick-start/
Other
41.52k stars 2.62k forks source link

DeprecationWarning: worker.suicide is deprecated #2780

Closed svipas closed 7 years ago

svipas commented 7 years ago

Bug

2017-03-19 17:45:49: (node:4680) DeprecationWarning: worker.suicide is deprecated. Please use worker.exitedAfterDisconnect

Software versions used

OS         : Linux Ubuntu 16.04
node.js    : v7.7.3
PM2        : v2.4.2

PM2 Log output

2017-03-19 17:45:49: Starting execution sequence in -cluster mode- for app name:server id:0
2017-03-19 17:45:49: App name:server id:0 online
2017-03-19 17:45:49: Starting execution sequence in -cluster mode- for app name:server id:1
2017-03-19 17:45:49: (node:4680) DeprecationWarning: worker.suicide is deprecated. Please use worker.exitedAfterDisconnect.
2017-03-19 17:45:49: App name:server id:1 online
2017-03-19 17:45:49: Starting execution sequence in -cluster mode- for app name:server id:2
2017-03-19 17:45:49: (node:4680) DeprecationWarning: worker.suicide is deprecated. Please use worker.exitedAfterDisconnect.
2017-03-19 17:45:49: App name:server id:2 online
2017-03-19 17:45:49: Starting execution sequence in -cluster mode- for app name:server id:3
2017-03-19 17:45:49: (node:4680) DeprecationWarning: worker.suicide is deprecated. Please use worker.exitedAfterDisconnect.
2017-03-19 17:45:49: App name:server id:3 online
2017-03-19 17:45:49: (node:4680) DeprecationWarning: worker.suicide is deprecated. Please use worker.exitedAfterDisconnect.
vmarchaud commented 7 years ago

Are you sure that your daemon is up-to-date ? Try making a pm2 update and see if the warning is still there.

svipas commented 7 years ago

@vmarchaud PM version 2.4.2, did and still the same warning.

sanpoChew commented 7 years ago

can confirm, getting the same warning with pm2 2.4.2 and node 7.7.2

jyotman commented 7 years ago

Same here on Ubuntu 16.04! pm2 2.4.4 node 7.9.0

damianobarbati commented 7 years ago

news on this?

vmarchaud commented 7 years ago

It's a warning, you can ignore it.

Unitech commented 7 years ago

we never use .suicide in pm2, I don't understand how this warning end up in logs

isaacs commented 7 years ago

Is it possible to run your app with the --trace-deprecation argument? Like node --trace-deprecation my-app.js This will show where the deprecated API is being used.

vmarchaud commented 7 years ago

@isaacs I read the PR over https://github.com/nodejs/node/pull/13684, currently i am maintaining PM2. But as Unitech said, we dropped the use of worker.suicide already few months back so we don't really understand from where it can be coming. I actually run on the issue localy multiple times but ignored it, i'll try with --trace-deprecation tomorrow (don't hesitate to ping me i might forget ^^)

isaacs commented 7 years ago

@vmarchaud Any update on this? This is me pinging you because maybe you forgot :)

vmarchaud commented 7 years ago

Able to reproduce, it's coming from a dependency fclone, could you check it out @soyuka ?

2017-06-20 21:20:22: (node:30836) [DEP0007] DeprecationWarning: worker.suicide is deprecated. Please use worker.exitedAfterDisconnect.
    at fclone (/home/vmarchaud/keymetrics/pm2/node_modules/fclone/dist/fclone.js:74:32)
    at Object.clone (/home/vmarchaud/keymetrics/pm2/lib/Utility.js:60:12)
    at /home/vmarchaud/keymetrics/pm2/lib/God/ActionMethods.js:204:32
    at ready (/home/vmarchaud/keymetrics/pm2/lib/God.js:150:15)
    at Worker.<anonymous> (/home/vmarchaud/keymetrics/pm2/lib/God.js:197:18)
    at Object.onceWrapper (events.js:312:19)
    at emitNone (events.js:105:13)
    at Worker.emit (events.js:207:7)
    at online (internal/cluster/master.js:249:10)
    at Worker.onmessage (internal/cluster/master.js:236:5)

Corresponding to this line in the source

EDIT: Looks like its a little problem with the cloning of enumerable property.

vmarchaud commented 7 years ago

@isaacs I don't think we can actually avoid accessing worker.suicide because we can't just hardcode a key inside fclone to ignore it and we need to access it anyway to see if it's a function. But anyway it should have no impact if removed since we don't use it.

soyuka commented 7 years ago

I propose we close this as a wontfix. We don't use worker.suicide and therefore we can safely ignore the warning. This warning only shows up because we access the suicide getter, without calling the method.

extensionsapp commented 7 years ago

Hello.


PM2        | App name:hello.com id:1 online
PM2        | (node:14176) [DEP0007] DeprecationWarning: worker.suicide is deprecated. Please use worker.exitedAfterDisconnect.
PM2        | Change detected on path core for app hello.com - restarting
PM2        | Stopping app:hello.com id:1
PM2        | pid=20058 msg=failed to kill - retrying in 100ms
PM2        | pid=20058 msg=failed to kill - retrying in 100ms
PM2        | pid=20058 msg=failed to kill - retrying in 100ms
PM2        | Process with pid 20058 still alive after 1600ms, sending it SIGKILL now...
PM2        | App name:hello.com id:1 disconnected
PM2        | App [hello.com] with id [1] and pid [20058], exited with code [0] via signal [SIGABRT]
PM2        | pid=20058 msg=process killed
PM2        | Starting execution sequence in -cluster mode- for app name:hello.com id:1
PM2        | App name:hello.com id:1 online
PM2        | (node:14176) [DEP0007] DeprecationWarning: worker.suicide is deprecated. Please use worker.exitedAfterDisconnect.
PM2        | Change detected on path core for app hello.com - restarting
PM2        | Stopping app:hello.com id:1
PM2        | pid=20083 msg=failed to kill - retrying in 100ms
PM2        | pid=20083 msg=failed to kill - retrying in 100ms
PM2        | pid=20083 msg=failed to kill - retrying in 100ms
PM2        | pid=20083 msg=failed to kill - retrying in 100ms
PM2        | pid=20083 msg=failed to kill - retrying in 100ms
PM2        | pid=20083 msg=failed to kill - retrying in 100ms
PM2        | pid=20083 msg=failed to kill - retrying in 100ms
PM2        | pid=20083 msg=failed to kill - retrying in 100ms
PM2        | pid=20083 msg=failed to kill - retrying in 100ms
PM2        | pid=20083 msg=failed to kill - retrying in 100ms
PM2        | Process with pid 20083 still alive after 1600ms, sending it SIGKILL now...
PM2        | App name:hello.com id:1 disconnected
PM2        | App [hello.com] with id [1] and pid [20083], exited with code [0] via signal [SIGABRT]
PM2        | pid=20083 msg=process killed
PM2        | Starting execution sequence in -cluster mode- for app name:hello.com id:1
PM2        | App name:hello.com id:1 online
PM2        | (node:14176) [DEP0007] DeprecationWarning: worker.suicide is deprecated. Please use worker.exitedAfterDisconnect.
soyuka commented 7 years ago

@extensionsapp the deprecation is not related and is not the one responsible of the app being killed.

epozsh commented 6 years ago

Hello,

in version 2.10.3 the warning still there.

feryardiant commented 6 years ago

Same issue with v2.10.3

image

asfo commented 6 years ago

Same issue with v3.1.2

vmarchaud commented 6 years ago

Please ignore it, it's not a problem