console: don't attach unnecessary error handlers#27691
Merged
cjihrig merged 1 commit intonodejs:masterfrom May 16, 2019
Merged
Conversation
Collaborator
addaleax
approved these changes
May 14, 2019
Member
addaleax
left a comment
There was a problem hiding this comment.
Can you add a regression test?
Contributor
Author
Sure. Done! |
Contributor
|
I think the test can be simplified further to something like: 'use strict';
const common = require('../common');
const { Worker, isMainThread } = require('worker_threads');
const EventEmitter = require('events');
if (isMainThread) {
process.on('warning', common.mustNotCall('unexpected warning'));
for (let i = 0; i < EventEmitter.defaultMaxListeners; ++i) {
(new Worker(__filename)).on('exit', () => {
console.log('a');
});
}
} |
BridgeAR
approved these changes
May 14, 2019
devsnek
approved these changes
May 14, 2019
Fishrock123
approved these changes
May 14, 2019
Collaborator
Trott
approved these changes
May 14, 2019
Collaborator
|
CI: https://ci.nodejs.org/job/node-test-pull-request/23118/ EDIT(cjihrig): CI was yellow. |
trivikr
approved these changes
May 15, 2019
A noop error handler is attached to the console's stream on write. The handler is then immediately removed after the write. This commit skips adding the error handler if one already exists. PR-URL: nodejs#27691 Fixes: nodejs#27687 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
targos
pushed a commit
that referenced
this pull request
May 17, 2019
A noop error handler is attached to the console's stream on write. The handler is then immediately removed after the write. This commit skips adding the error handler if one already exists. PR-URL: #27691 Fixes: #27687 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A noop error handler is attached to the console's stream on write. The handler is then immediately removed after the write. This commit skips adding the error handler if one already exists.
Fixes: #27687
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes