From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 1ABAA2FEB0 for ; Thu, 22 Nov 2018 12:21:14 -0500 (EST) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id SaaBIIMvwgZG for ; Thu, 22 Nov 2018 12:21:14 -0500 (EST) Received: from smtp54.i.mail.ru (smtp54.i.mail.ru [217.69.128.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id C874A2FEA4 for ; Thu, 22 Nov 2018 12:21:13 -0500 (EST) From: Serge Petrenko Subject: [tarantool-patches] [PATCH 0/2] box: implement on_shutdown triggers Date: Thu, 22 Nov 2018 20:20:53 +0300 Message-Id: Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-subscribe: List-owner: List-post: List-archive: To: kostja@tarantool.org, tarantool-patches@freelists.org 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 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)