Skip to content

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 those upto speed.

This is required by node-report; however given its independent existence raising is a separate one.

I wish I could add a test for this, but realize it might not be possible, as the logic is exercised within the boot sequence that is not influenced / intercepted by any test cases.

Ref: https://github.com/nodejs/node/pull/22712#discussion_r232457318

/cc @addaleax

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

Merge request reports

Loading