Tarantool development patches archive
 help / color / mirror / Atom feed
From: Georgy Kirichenko <georgy@tarantool.org>
To: tarantool-patches@freelists.org
Cc: Konstantin Osipov <kostja@tarantool.org>,
	Maxim Melentiev <m.melentiev@corp.mail.ru>,
	k.nazarov@corp.mail.ru
Subject: [tarantool-patches] Re: [PATCH] Make `tarantoolctl start` work withiout box.cfg in init script
Date: Mon, 12 Aug 2019 16:01:35 +0300	[thread overview]
Message-ID: <5668311.GLNk2tWfSB@localhost> (raw)
In-Reply-To: <20190812103151.GA30718@atlas>

[-- Attachment #1: Type: text/plain, Size: 3209 bytes --]

On Monday, August 12, 2019 1:31:51 PM MSK Konstantin Osipov wrote:
> * Maxim Melentiev <m.melentiev@corp.mail.ru> [19/08/09 21:39]:
> > 1) wrapper_cfg does not override config but provides defaults,
> > overwriting only `username` and `background` options.
> 
> You can do the same with setenv.
> 
> > 2) If I get the suggestion right, suggested final solution should work
> > this way:
> > 
> > tarantoolctl start
> > 
> >   io.daemon() -- parent exits, child goes to bg
which way you suggest to use here to control execution state
> >   exec(init_script, env_with_box_cfg_overrides)
here to
> >   
> >     init_script
> >     
> >       box.cfg() -- uses overrides from env
> 
> Yes.
> 
> > tarantoolctl will always return with 0 code, no mater if there is error in
> > main script or not. Maybe it’s just wrong naming and it should be
> > `io.fork` instead, allowing parent to continue and wait for READY=1 on
> > NOTIFY_SOCKET.
> 
> No, the parent of io.daemon() can wait for the child to start.
What you mean for the word "start" - a process is created, a special event 
happened or something else?
> 
> > If it is expected to work this way
> > 
> > tarantoolctl start
> > 
> >   exec(init_script, env_with_box_cfg_overrides)
> >   
> >     if (ENV.TNT_DAEMONIZE) io.daemon() -- parent exits, child goes to bg
> >     init_script
> >     
> >       box.cfg() -- uses overrides from env
> > 
> > it also won’t show errors from child process.
> > 
> > 3) io.daemon is expected to close STD* FDs in child process, isn’t it?
> > If so - child won’t be able to show errors during startup after
> > daemonization if any. Current implementation of `tarantoolctl start`
> > shows this errors and exits with non-zero code.
> > 
> > 4) `tarantoolctl start` would exit before init_script is finished
> > (actually even before it’s started).
> > 
> > Are this incompatibilities acceptable?
> 
> No, we need to get the same semantics as your patch and we'll find
> a way to do it.

> 
> > Tarantool’s built-in toolset (tarantoolctl) does not work for app-server
> > applications but only for DB apps. The changes you’re suggesting are more
> > robust and complex, it may take significant amount of time to resolve all
> > issues and consider all details. This patch solves the problem in
> > backward-compatible way right now.
> > 
> > We would like to open-source modules which makes it much easier to use
> > tarantool as app server soon. The issue brings a limitation: “Don’t use
> > this module with tarantoolctl (because it’s buggy)”.
> Well, your patch is not good, even though it solves your issues
> now. So let's take a longer route.
The biggest issue I see we don't have any clue how to control application on 
each stage of it's life. How could application to report an error or unwanted 
state right after daemonization (or even after READY=1 written) but before 
application is really initialized. We do not have even logging here (logger is 
initialized while box.cfg fired).
I think we need a framework which allows to customize and to control 
application which includes logging and application state.

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2019-08-12 13:01 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-09  8:10 [tarantool-patches] " Max Melentiev
2019-08-09 13:42 ` [tarantool-patches] " Konstantin Osipov
2019-08-09 18:38   ` Maxim Melentiev
2019-08-12 10:31     ` Konstantin Osipov
2019-08-12 13:01       ` Georgy Kirichenko [this message]
2019-08-12 13:24         ` Konstantin Osipov
2019-08-12 13:24         ` Konstantin Osipov
2019-08-12 16:10           ` Георгий Кириченко
2019-08-12 21:42             ` 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=5668311.GLNk2tWfSB@localhost \
    --to=georgy@tarantool.org \
    --cc=k.nazarov@corp.mail.ru \
    --cc=kostja@tarantool.org \
    --cc=m.melentiev@corp.mail.ru \
    --cc=tarantool-patches@freelists.org \
    --subject='[tarantool-patches] Re: [PATCH] Make `tarantoolctl start` work withiout box.cfg in init script' \
    /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