I am working on a REDIS datastore application. To preserve data integrity, I would like to empty the repository at the end of the process.
I created a function handler and linked it (with process.on ()) to signal events: uncaughtException, SIGINT, SIGTERM, SIGQUIT, and it works well (CTRL + C, process processing, exception, ...).
But I read that under certain conditions, a process can exit directly without triggering other signal events.
The problem in this particular case is that the process.on ('exit') handler can only handle synchronous tasks.
I did different tests to try to kill the process in different ways. And (except for SIGTERM on Windows) I could not determine the case where process.on ('exit') is started directly without SIGINT, SIGTERM or another event.
So my question is (on a Linux system) under what conditions can a process exit directly without triggering this event: http://nodejs.org/api/all.html#all_signal_events
damien
source share