Call SignalExit() from custom node signal handler #39568
Replies: 3 comments 3 replies
-
@fabriciomurta - isn't that we want, by design? can you elaborate your use case a little? are you wanting
|
Beta Was this translation helpful? Give feedback.
-
@fabriciomurta - thanks, this is indeed an interesting case! the very heart of signal chaining is this:
this is largely useful with layered applications running in managed runtimes wherein, a signal with a well defined meaning needs to be over-ridden by the app for what ever reason, without loosing its original meaning in the lower stack components (example: SIGUSR2 in some Java variants means collect heap and text dumps, in Node.js to collect report etc. and the app wants to do some custom action too). The key here is that the person who "pugs" the signal also knows that the other handler also will be (and needs to be) called. Please note that this is not currently available in Node.js
To make it super simple, will this help your case? |
Beta Was this translation helpful? Give feedback.
-
@fabriciomurta - this is indeed a great discussion!
makes sense to me! the one caveat though is that it has to be either a separate API, or the existing one with a non-default option; or else the behavioral change will be disruptive - for example a user who over-riden the default SIGINT with a custom handler will now see the custom handling followed by the termination (default OS handler's action) |
Beta Was this translation helpful? Give feedback.
-
NodeJS's signalExit() nicely resets terminal on exit, cross platform (POSIX?) friendly. Problem is, if I handle
SIGINT
orSIGTERM
, the default handler would no longer be triggered. Is there a way I can just keep default handler after I do my job?Beta Was this translation helpful? Give feedback.
All reactions