Tarantool development patches archive
 help / color / mirror / Atom feed
From: Serge Petrenko <sergepetrenko@tarantool.org>
To: kostja@tarantool.org, tarantool-patches@freelists.org
Cc: Serge Petrenko <sergepetrenko@tarantool.org>
Subject: [tarantool-patches] [PATCH 0/2] box: implement on_shutdown triggers
Date: Thu, 22 Nov 2018 20:20:53 +0300	[thread overview]
Message-ID: <cover.1542906167.git.sergepetrenko@tarantool.org> (raw)

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

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.

Konstantin Osipov (1):
  box: implement on_shutdown triggers

Serge Petrenko (1):
  box: introduce on_shutdown triggers to lua

 src/box/box.cc         | 10 ++++++++++
 src/box/box.h          | 11 +++++++++++
 src/box/lua/ctl.c      | 21 +++++++++++++++++++++
 src/main.cc            |  2 ++
 test/box/misc.result   | 34 ++++++++++++++++++++++++++++++++++
 test/box/misc.test.lua | 14 ++++++++++++++
 6 files changed, 92 insertions(+)

-- 
2.17.2 (Apple Git-113)

             reply	other threads:[~2018-11-22 17:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-22 17:20 Serge Petrenko [this message]
2018-11-22 17:20 ` [tarantool-patches] [PATCH 1/2] " Serge Petrenko
2018-11-22 17:20 ` [tarantool-patches] [PATCH 2/2] box: introduce on_shutdown triggers to lua Serge Petrenko
2018-11-23 10:37   ` [tarantool-patches] " Konstantin Osipov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1542906167.git.sergepetrenko@tarantool.org \
    --to=sergepetrenko@tarantool.org \
    --cc=kostja@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='Re: [tarantool-patches] [PATCH 0/2] box: implement on_shutdown triggers' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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