Tarantool development patches archive
 help / color / mirror / Atom feed
* [tarantool-patches] [PATCH v2 0/3] box: implement on_shutdown triggers
@ 2018-11-26 14:25 Serge Petrenko
  2018-11-26 14:25 ` [tarantool-patches] [PATCH v2 1/3] " Serge Petrenko
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Serge Petrenko @ 2018-11-26 14:25 UTC (permalink / raw)
  To: kostja, tarantool-patches; +Cc: Serge Petrenko

This patchset adds on_shutdown triggers which can be registered from lua 
via box.ctl.on_shutdown() and are run on tarantool shutdown.

Issue: https://github.com/tarantool/tarantool/issues/1607
Branch: https://github.com/tarantool/tarantool/tree/sp/gh-1607-on-exit-triggers

Changes in v2: 
  - added 3rd patch which passes signals to triggers.
  - run on_shutdown triggers even if box is not configured.
  - add a documentation request to the 3rd patch.

First patch was originally made by Kostja and implemented on_shutdown
triggers. I had to alter it a bit so that on shutdown box_free() is
called after coio_shutdown(). Otherwise tarantool hung on shutdown
occasionally. I also factored out trigger_run() into a separate function 
box_run_on_shutdown_triggers(), so that on_shutdown triggers are still
run before anything else is freed or shut down.

Second patch expands box.ctl interface by introducing box.ctl.on_shutdown()
function to register on_shutdown triggers from lua.

Third patch adds the ability to pass signal which caused termination to
the on_shutdown trigger.

Konstantin Osipov (1):
  box: implement on_shutdown triggers

Serge Petrenko (2):
  box: introduce on_shutdown triggers to lua
  box: pass signal to on_shutdown triggers

 src/box/box.cc         |  8 ++++++++
 src/box/box.h          | 12 ++++++++++++
 src/box/lua/ctl.c      | 23 ++++++++++++++++++++++
 src/main.cc            | 10 +++++++++-
 test/box/misc.result   | 44 ++++++++++++++++++++++++++++++++++++++++++
 test/box/misc.test.lua | 17 ++++++++++++++++
 6 files changed, 113 insertions(+), 1 deletion(-)

-- 
2.17.2 (Apple Git-113)

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-11-26 14:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-26 14:25 [tarantool-patches] [PATCH v2 0/3] box: implement on_shutdown triggers Serge Petrenko
2018-11-26 14:25 ` [tarantool-patches] [PATCH v2 1/3] " Serge Petrenko
2018-11-26 14:25 ` [tarantool-patches] [PATCH v2 2/3] box: introduce on_shutdown triggers to lua Serge Petrenko
2018-11-26 14:25 ` [tarantool-patches] [PATCH v2 3/3] box: pass signal to on_shutdown triggers Serge Petrenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox