On Fri, Dec 28, 2018 at 10:43:26AM +0300, Konstantin Osipov wrote:
* Vladimir Davydov <vdavydov.dev@gmail.com> [18/12/27 16:00]:
On Tue, Dec 11, 2018 at 04:24:38PM +0300, Serge Petrenko wrote:
Move a call to tarantool_free() to the end of main().
Also instead of breaking the event loop directly when processing a
signal start a fiber which can do some work before event loop break and
then break the event loop (this will be helpful when on_shutdown
triggers are implemented to run them while ev loop active).
Only wal_thread_stop() is left in atexit() to make sure we close the
journal in case the user exits by typing os.exit() to the console.
I don't understand why you need to do it in the scope of the issue
you're intending to fix. You can start a fiber from SITERM/SIGINT signal
handler and run on_shutdown triggers from it without atexit rework,
right?
I asked Sergey to refactor our atexit machinery. I want atexit
handlers to be able to run the event loop, all such handlers, not
just the exit trigger.
But this isn't what this patch does - it just moves some code from
atexit() to the end of main, after the event loop is stopped.
This is OK for existing handlers, since they don't require an
event loop today.
Then why move them from atexit() to the end of main()? It doesn't
achieve anything, it doesn't have anything to do with on_shutdown
trigger. For some reason, we just stop freeing memory if the program
terminates by exit()-ing.