From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Serge Petrenko Message-Id: <5DA4BFB2-06E9-4B2F-8672-A5A745FCDB13@tarantool.org> Content-Type: multipart/alternative; boundary="Apple-Mail=_E92A7E48-69B1-4DC6-8398-1C77A7960A7E" Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: Re: [tarantool-patches] Re: [PATCH v3 1/3] box: get rid of atexit() for calling cleanup routine Date: Sat, 29 Dec 2018 16:54:00 +0300 In-Reply-To: <20181228075812.nhtchuubtnxkxyuj@esperanza> References: <98b93e4fd2d6d6affb4dc191ad5d4e8432ffefaa.1544533138.git.sergepetrenko@tarantool.org> <20181227124355.hmoioqgodmkcjclu@esperanza> <20181227125058.GH18166@chai> <20181227125620.2o7xgjts5pmljesm@esperanza> <20181228074326.GA8619@chai> <20181228075812.nhtchuubtnxkxyuj@esperanza> To: Vladimir Davydov Cc: tarantool-patches@freelists.org, Konstantin Osipov List-ID: --Apple-Mail=_E92A7E48-69B1-4DC6-8398-1C77A7960A7E Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Hi! I addressed your comments regarding all the 3 patches and sent v4 for review (=C2=AB[PATCH v4 0/2] box: implement on_shutdown = triggers=C2=BB) As for this particular patch, I made it independent from the next one, so it may be dropped altogether if you wish. > 28 =D0=B4=D0=B5=D0=BA. 2018 =D0=B3., =D0=B2 10:58, Vladimir Davydov = =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB(=D0=B0= ): >=20 > On Fri, Dec 28, 2018 at 10:43:26AM +0300, Konstantin Osipov wrote: >> * 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. >>>>>=20 >>>>> 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? >>>>=20 >>>> 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. >>>=20 >>> 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. >>=20 >> This is OK for existing handlers, since they don't require an >> event loop today.=20 >=20 > 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. >=20 --Apple-Mail=_E92A7E48-69B1-4DC6-8398-1C77A7960A7E Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 Hi!
I addressed your comments regarding all = the 3 patches and
sent v4 for review (=C2=AB[PATCH v4 0/2] box: implement on_shutdown = triggers=C2=BB)

As for this particular patch, I made it independent from the = next one,
so it may be dropped altogether if you = wish.

28 =D0=B4=D0=B5=D0=BA. 2018 =D0=B3., =D0=B2 = 10:58, Vladimir Davydov <vdavydov.dev@gmail.com> =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0= =B0=D0=BB(=D0=B0):

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.


= --Apple-Mail=_E92A7E48-69B1-4DC6-8398-1C77A7960A7E--