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

'disconnect' event is not emitted on cluster.worker #1304

Closed
Olegas opened this issue Mar 31, 2015 · 4 comments
Closed

'disconnect' event is not emitted on cluster.worker #1304

Olegas opened this issue Mar 31, 2015 · 4 comments
Labels
cluster Issues and PRs related to the cluster subsystem.

Comments

@Olegas
Copy link
Contributor

Olegas commented Mar 31, 2015

Demo app here: https://gist.github.com/Olegas/c2e5550911cbe8b96dae

Steps to reproduce:

  1. Start app, wait 10 sec
  2. App is terminated and log show the following lines
Master started
Worker started
Worker listening
Disconnecting worker
Cluster: worker is disconnected

Expected result:
Line Worker disconnected (from https://gist.github.com/Olegas/c2e5550911cbe8b96dae#file-demo-js-L26) is present in log as stated in docs: https://iojs.org/api/cluster.html#cluster_event_disconnect_1

If I change line 25 to cluster.worker.process.on('disconnect', ... it works fine.

@Fishrock123 Fishrock123 added the cluster Issues and PRs related to the cluster subsystem. label Mar 31, 2015
@Olegas
Copy link
Contributor Author

Olegas commented Apr 1, 2015

Can we just add worker.emit('disconnect'); just above this line: https://github.com/iojs/io.js/blob/v1.x/lib/cluster.js#L510

@cjihrig
Copy link
Contributor

cjihrig commented Apr 9, 2015

@Olegas that sounds correct to me. Currently, there is no parallel for this in the cluster child process worker. Do you want to open a PR, or should I?

@Olegas
Copy link
Contributor Author

Olegas commented Apr 9, 2015

I'll do

Olegas added a commit to Olegas/io.js that referenced this issue Apr 9, 2015
Fix for nodejs#1304
Inside of a worker, disconnect event was not emitted on cluster.worker
Olegas added a commit to Olegas/io.js that referenced this issue Apr 9, 2015
Fix for nodejs#1304
Inside of a worker, disconnect event was not emitted on cluster.worker
brendanashworth pushed a commit that referenced this issue May 8, 2015
Inside of a worker, disconnect event was not emitted on cluster.worker

Fixes: #1304
PR-URL: #1386
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
@brendanashworth
Copy link
Contributor

Should be fixed as of 5883a59.

Fishrock123 pushed a commit to Fishrock123/node that referenced this issue May 19, 2015
Inside of a worker, disconnect event was not emitted on cluster.worker

Fixes: nodejs#1304
PR-URL: nodejs#1386
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cluster Issues and PRs related to the cluster subsystem.
Projects
None yet
Development

No branches or pull requests

4 participants