lib: move signal event handling into bootstrap/node.js#25859
Closed
joyeecheung wants to merge 1 commit intonodejs:masterfrom
Closed
lib: move signal event handling into bootstrap/node.js#25859joyeecheung wants to merge 1 commit intonodejs:masterfrom
joyeecheung wants to merge 1 commit intonodejs:masterfrom
Conversation
Moves the `process.on()` and `promise.emit()` calls happened during bootstrap for signal events into `bootstrap/node.js` so it's easier to tell the side effects. Drive-by changes: - Moves the signal event re-arming to a point later during the bootstrap - as early as it were it's unlikely that there could be any existing signal events to re-arm for node-report. - Use a Map instead of an Object for signal wraps since it is used as a deletable dictionary anyway.
Member
Author
addaleax
approved these changes
Jan 31, 2019
| process.emit('newListener', ev); | ||
| } | ||
| } | ||
|
|
Member
There was a problem hiding this comment.
Is there any specific reason for placing this block of code at this location? Why I ask is:
- the re-arming logic was introduced to support
report- though it supports any code block that registers signals while in the bootstrap process. - right now the signal handler setup is established just before the report is established, making the re-arming un-necessary, at least for report.
- if we place this block of code as early as the process object's creation, we can eliminate the re-arming
- if we place this block as late as towards the exit of setup, the re-arming will be leveraged by any one in the middle.
- right now it seems to be a mix of both
and hence my question on the placement - is there any other considerations for this being here?
Code changes looks good to me.
Member
Author
There was a problem hiding this comment.
In fact I wonder if this is ever possible to trigger...as far as I can tell no signals events should be registered at this point (inside node.js) as now the stdio streams are lazily instantiated, and the branch has been yellow (never executed) in the coverage report
Member
Author
Member
Author
|
Landed in 041424f |
joyeecheung
added a commit
that referenced
this pull request
Feb 7, 2019
Moves the `process.on()` and `promise.emit()` calls happened during bootstrap for signal events into `bootstrap/node.js` so it's easier to tell the side effects. Drive-by changes: - Moves the signal event re-arming to a point later during the bootstrap - as early as it were it's unlikely that there could be any existing signal events to re-arm for node-report. - Use a Map instead of an Object for signal wraps since it is used as a deletable dictionary anyway. PR-URL: #25859 Reviewed-By: Anna Henningsen <anna@addaleax.net>
targos
pushed a commit
that referenced
this pull request
Feb 10, 2019
Moves the `process.on()` and `promise.emit()` calls happened during bootstrap for signal events into `bootstrap/node.js` so it's easier to tell the side effects. Drive-by changes: - Moves the signal event re-arming to a point later during the bootstrap - as early as it were it's unlikely that there could be any existing signal events to re-arm for node-report. - Use a Map instead of an Object for signal wraps since it is used as a deletable dictionary anyway. PR-URL: #25859 Reviewed-By: Anna Henningsen <anna@addaleax.net>
Merged
This was referenced Feb 15, 2019
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.
Moves the
process.on()andpromise.emit()calls happened duringbootstrap for signal events into
bootstrap/node.jsso it's easierto tell the side effects.
Drive-by changes:
the bootstrap - as early as it were it's unlikely that there
could be any existing signal events to re-arm for node-report.
as a deletable dictionary anyway.
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes