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 0D2A1211C6 for ; Fri, 28 Dec 2018 02:43:30 -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 5Fj-MrAbvopL for ; Fri, 28 Dec 2018 02:43:29 -0500 (EST) Received: from smtp46.i.mail.ru (smtp46.i.mail.ru [94.100.177.106]) (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 67541210B0 for ; Fri, 28 Dec 2018 02:43:29 -0500 (EST) Date: Fri, 28 Dec 2018 10:43:26 +0300 From: Konstantin Osipov Subject: [tarantool-patches] Re: [PATCH v3 1/3] box: get rid of atexit() for calling cleanup routine Message-ID: <20181228074326.GA8619@chai> References: <98b93e4fd2d6d6affb4dc191ad5d4e8432ffefaa.1544533138.git.sergepetrenko@tarantool.org> <20181227124355.hmoioqgodmkcjclu@esperanza> <20181227125058.GH18166@chai> <20181227125620.2o7xgjts5pmljesm@esperanza> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181227125620.2o7xgjts5pmljesm@esperanza> 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: tarantool-patches@freelists.org Cc: Serge Petrenko * Vladimir Davydov [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. -- Konstantin Osipov, Moscow, Russia, +7 903 626 22 32 http://tarantool.io - www.twitter.com/kostja_osipov