Title: cluster: suicide flag is not set on master when calling disconnect from a worker · Issue #3238 · nodejs/node · GitHub
Open Graph Title: cluster: suicide flag is not set on master when calling disconnect from a worker · Issue #3238 · nodejs/node
X Title: cluster: suicide flag is not set on master when calling disconnect from a worker · Issue #3238 · nodejs/node
Description: From the documentation: worker.suicide: Set by calling .kill() or .disconnect(), until then it is undefined. worker.disconnect(): In a worker, this function will close all servers, wait for the 'close' event on those servers, and then di...
Open Graph Description: From the documentation: worker.suicide: Set by calling .kill() or .disconnect(), until then it is undefined. worker.disconnect(): In a worker, this function will close all servers, wait for the 'cl...
X Description: From the documentation: worker.suicide: Set by calling .kill() or .disconnect(), until then it is undefined. worker.disconnect(): In a worker, this function will close all servers, wait for the ...
Opengraph URL: https://github.com/nodejs/node/issues/3238
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"cluster: suicide flag is not set on master when calling disconnect from a worker","articleBody":"From the documentation:\n\n[`worker.suicide`](https://nodejs.org/api/cluster.html#cluster_worker_suicide):\n\n\u003e Set by calling .kill() or .disconnect(), until then it is undefined.\n\n[`worker.disconnect()`](https://nodejs.org/api/cluster.html#cluster_worker_disconnect):\n\n\u003e In a worker, this function will close all servers, wait for the 'close' event on those servers, and then disconnect the IPC channel.\n\u003e \n\u003e Causes .suicide to be set.\n\nRepro:\n\n``` javascript\nvar cluster = require('cluster');\n\nif (cluster.isMaster) {\n // Master forks and listens for events\n var worker = cluster.fork();\n cluster.on('disconnect', function(){\n console.log(\"disconnect\", worker.suicide);\n });\n cluster.on('exit', function(){\n console.log(\"exit\", worker.suicide);\n });\n} else {\n // Worker just disconnects\n cluster.worker.disconnect();\n}\n```\n\nIn node v0.10, both log statements would print `true` for `worker.suicide`. In 41b75ca9263f368db790fbdcc3963bb1a8c5cb7e, which landed during the v0.11 branch, this was broken, and all versions up to node v4 will print `false`. This is because `worker.disconnect()`, when called from the worker, does not send the `suicide` message anymore -- only `worker.destroy()` will send that message to the master.\n","author":{"url":"https://github.com/dpatti","@type":"Person","name":"dpatti"},"datePublished":"2015-10-07T15:25:07.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":5},"url":"https://github.com/3238/node/issues/3238"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:60647a18-5725-5221-952b-4fa044344b0b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9B50:323A96:21B9AF:30F941:6A4DFFEB |
| html-safe-nonce | 8f904d311f14d3bee3d9fcdf6d66f5ad0a30123bc38e8fc2b681ef5120538554 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QjUwOjMyM0E5NjoyMUI5QUY6MzBGOTQxOjZBNERGRkVCIiwidmlzaXRvcl9pZCI6Ijg0NDU1OTAxMjIwNDUxMTIxMSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | d9ab366961d2d7b0d3c6c3511a175f99d62490e4735694457851e4547faceec7 |
| hovercard-subject-tag | issue:110250325 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/3238/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b995c705e2b23064f27e6d1f1b01dc82d8ec940066fb6fba09482b7bf68076ae/nodejs/node/issues/3238 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b995c705e2b23064f27e6d1f1b01dc82d8ec940066fb6fba09482b7bf68076ae/nodejs/node/issues/3238 |
| og:image:alt | From the documentation: worker.suicide: Set by calling .kill() or .disconnect(), until then it is undefined. worker.disconnect(): In a worker, this function will close all servers, wait for the 'cl... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dpatti |
| hostname | github.com |
| expected-hostname | github.com |
| None | df0492960db29b4938cb72070351d6b1d0c6c0767b27ceb8394bbf4fcc0223c6 |
| turbo-cache-control | no-preview |
| go-import | github.com/nodejs/node git https://github.com/nodejs/node.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 27193779 |
| octolytics-dimension-repository_nwo | nodejs/node |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 27193779 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 52bde38e24398476f8eb1e0760c81346c6a00812 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width