★ wanayoo — archive 1999 https://github.com/nodejs/node/commit/83ab5f4049Nouvelle recherche | Portail wanayoo
Skip to content
Permalink
Browse files
lib: rearm pre-existing signal event registrations
process.on('somesignal', ...) semantics expect the process to catch the
signal and invoke the associated handler. `setupSignalHandlers` perform
the additional task of preparing the libuv signal handler and associate
it with the event handler. It is possible that by the time this is
setup there could be pre-existing registrations that pre-date this setup
in the boot sequence.

So rearm pre-existing signal event registrations to get upto speed.

Ref: #22712 (comment)

PR-URL: #24651
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
  • Loading branch information
gireeshpunathil authored and targos committed Nov 29, 2018
1 parent b3e77a5 commit 83ab5f4049883228190afcd5b1caf4c70b2b67ab
Showing with 7 additions and 0 deletions.
  1. +7 −0 lib/internal/process/main_thread_only.js
@@ -154,6 +154,13 @@ function setupSignalHandlers(internalBinding) {
delete signalWraps[type];
}
});

// re-arm pre-existing signal event registrations
// with this signal wrap capabilities.
process.eventNames().forEach((ev) => {
if (isSignal(ev))
process.emit('newListener', ev);
});
}

function setupChildProcessIpcChannel() {

0 comments on commit 83ab5f4

Please sign in to comment.