Tarantool development patches archive
 help / color / mirror / Atom feed
From: Cyrill Gorcunov <gorcunov@gmail.com>
To: Roman Khabibov <roman.habibov@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH] console: check on_shutdown() before exit
Date: Sun, 12 Apr 2020 13:37:21 +0300	[thread overview]
Message-ID: <20200412103721.GV3072@uranus> (raw)
In-Reply-To: <20200411231034.95903-1-roman.habibov@tarantool.org>

On Sun, Apr 12, 2020 at 02:10:34AM +0300, Roman Khabibov wrote:
> Add check that on_shutdown() triggers were called before exit,
> because in case of EOF or Ctrl+D (no signals) they were ignored.
> 
> Closes #4703

Ok, I don't see any obvious problems with the patch. Only a nit
due to coding style below.
...
> diff --git a/test/box/on_shutdown.test.lua b/test/box/on_shutdown.test.lua
> index 2a9143404..795887202 100644
> --- a/test/box/on_shutdown.test.lua
> +++ b/test/box/on_shutdown.test.lua
> @@ -65,3 +65,20 @@ test_run:grep_log('test', 'signal', nil, {noreset=true})
...
> +on_shutdown_cmd = "box.ctl.on_shutdown(function() local fio = require('fio') "..
> +    "fio.open('"..file_name.."', {'O_CREAT', 'O_TRUNC', 'O_WRONLY'}, 777):clo"..
> +    "se() end)";

This is ugly as hell. Can we please do not split "close". Something like

on_shutdown_cmd = "box.ctl.on_shutdown(function() local fio = require('fio') "..
	"fio.open('"..file_name.."', "..
	"{'O_CREAT', 'O_TRUNC', 'O_WRONLY'}, 777):close() end)";

Or somehow more readable? Maybe like

on_shutdown_cmd = "box.ctl.on_shutdown(function() local fio = require('fio') "..
	"local flags = {'O_CREAT', 'O_TRUNC', 'O_WRONLY'}" ..
	"local f = fio.open(mode, 777)" ..
	"f:close()"

(I'm sure I've done some typos here but you get the idea)

  reply	other threads:[~2020-04-12 10:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-11 23:10 Roman Khabibov
2020-04-12 10:37 ` Cyrill Gorcunov [this message]
2020-04-15  1:57   ` Roman Khabibov
2020-04-16 14:03     ` Cyrill Gorcunov
2020-04-17  6:55 ` Kirill Yukhin
2020-04-17 11:36   ` Roman Khabibov
2020-05-08  7:20 ` Kirill Yukhin

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=20200412103721.GV3072@uranus \
    --to=gorcunov@gmail.com \
    --cc=roman.habibov@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH] console: check on_shutdown() before exit' \
    /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