-
-
Notifications
You must be signed in to change notification settings - Fork 35.4k
cluster: remove deprecated problematic API #13684
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
Content Warning: mental health and self-harm triggers. --- The word "suicide" was used in the cluster API 4 years ago. This was a serious mistake for several reasons. It was deprecated in version 6, and long past time for full removal now. First, and most important, casual use of words referring to self-harm serve to stigmatize mental illness and make it harder for people in our community to literally stay alive. It is impossible to claim that we intend to be inclusive and welcoming, and also casually show such disrespect for the lives of those in our community. Some of us have lost friends or struggled with mental illness. Leaving this lying around tells us that we are not welcome. Second, in addition to being just wildly inappropriate on ethical and community grounds, the term "suicide" was never even appropriate technically! In context, it refers to a case where a child process exits without receiving a fatal signal from the parent process. The "cute" unix joke here is that the process "killed itself". However, the "suicide" flag is set regardless of how the process exited, so in addition to being offensive and harmful, it is also misleading and incorrect, and has always been so. (It could've thrown an error, called `process.exit()` or received a fatal signal from some other process.) An open source project is not the place for emotional landmines. It's distracting and misleading at best, and actively harmful at worst. There is no justification for it. The API has already been renamed, and it's an obscure surface that is unlikely to ever be used outside of core.
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -94,14 +94,6 @@ Within the [`child_process`][] module's `spawn()`, `fork()`, and `exec()` | |
| methods, the `options.customFds` option is deprecated. The `options.stdio` | ||
| option should be used instead. | ||
|
|
||
| <a id="DEP0007"></a> | ||
| ### DEP0007: cluster worker.suicide | ||
|
|
||
| Type: Runtime | ||
|
|
||
| Within the `cluster` module, the [`worker.suicide`][] property has been | ||
| deprecated. Please use [`worker.exitedAfterDisconnect`][] instead. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What I would recommend here is adding a short, non-emotional explanation why
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we at least add a content warning at the top of the file, that this document contains offensive and triggering language? |
||
|
|
||
| <a id="DEP0008"></a> | ||
| ### DEP0008: require('constants') | ||
|
|
||
|
|
@@ -688,8 +680,6 @@ Type: Runtime | |
| [`util.print()`]: util.html#util_util_print_strings | ||
| [`util.puts()`]: util.html#util_util_puts_strings | ||
| [`util`]: util.html | ||
| [`worker.exitedAfterDisconnect`]: cluster.html#cluster_worker_exitedafterdisconnect | ||
| [`worker.suicide`]: cluster.html#cluster_worker_suicide | ||
| [alloc]: buffer.html#buffer_class_method_buffer_alloc_size_fill_encoding | ||
| [alloc_unsafe_size]: buffer.html#buffer_class_method_buffer_allocunsafe_size | ||
| [from_arraybuffer]: buffer.html#buffer_class_method_buffer_from_arraybuffer_byteoffset_length | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,12 +7,12 @@ const cluster = require('cluster'); | |
| const worker = new cluster.Worker(); | ||
|
|
||
| assert.strictEqual(worker.exitedAfterDisconnect, undefined); | ||
| assert.strictEqual(worker.suicide, undefined); | ||
| assert.strictEqual(worker.exitedAfterDisconnect, undefined); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @gibfahn Yes, I agree, it seems like this test file can be removed rather than modified. |
||
|
|
||
| worker.exitedAfterDisconnect = 'recommended'; | ||
| assert.strictEqual(worker.exitedAfterDisconnect, 'recommended'); | ||
| assert.strictEqual(worker.suicide, 'recommended'); | ||
| assert.strictEqual(worker.exitedAfterDisconnect, 'recommended'); | ||
|
|
||
| worker.suicide = 'deprecated'; | ||
| worker.exitedAfterDisconnect = 'deprecated'; | ||
| assert.strictEqual(worker.exitedAfterDisconnect, 'deprecated'); | ||
| assert.strictEqual(worker.exitedAfterDisconnect, 'deprecated'); | ||
| assert.strictEqual(worker.suicide, 'deprecated'); | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -52,7 +52,6 @@ if (cluster.isWorker) { | |
| worker_emitDisconnect: [1, "the worker did not emit 'disconnect'"], | ||
| worker_emitExit: [1, "the worker did not emit 'exit'"], | ||
| worker_state: ['disconnected', 'the worker state is incorrect'], | ||
| worker_suicideMode: [false, 'the worker.suicide flag is incorrect'], | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. just to confirm, this mode was only entered when using the deprecated API correct? |
||
| worker_exitedAfterDisconnect: [ | ||
| false, 'the .exitedAfterDisconnect flag is incorrect' | ||
| ], | ||
|
|
@@ -84,7 +83,6 @@ if (cluster.isWorker) { | |
| // Check worker events and properties | ||
| worker.on('disconnect', common.mustCall(() => { | ||
| results.worker_emitDisconnect += 1; | ||
| results.worker_suicideMode = worker.suicide; | ||
| results.worker_exitedAfterDisconnect = worker.exitedAfterDisconnect; | ||
| results.worker_state = worker.state; | ||
| if (results.worker_emitExit > 0) { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-1 on this bit. Per the deprecation policy, the deprecation code is static and permanent and should remain in the documentation. The
Type:line should be changed toEnd-of-Life`.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it's more or less policy I think to leave the code?
Maybe we can just say "the predecessor to cluster worker.exitedAfterDisconnect"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That works for me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-1 on using roundabout wording. We can't remove problematic terminology from everywhere (for example, git history).
deprecations.mdis a file that has a very specific purpose, and most people will never look at it.Example: someone is trying to resurrect some old code that no longer works due to a call to a non-existent method. Searching for it in
deprecations.mdwould probably be the first step. If the section about a removed API doesn't name the API, then there's no point in having it at all.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, your probably right about that, unfortunately.