-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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: remove deprecated problematic API #13684
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
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. | ||
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 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); | ||
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. 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'], | ||
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.md
is 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.md
would 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.