Tarantool development patches archive
 help / color / mirror / Atom feed
From: Konstantin Osipov <kostja@tarantool.org>
To: tarantool-patches@freelists.org
Cc: Serge Petrenko <sergepetrenko@tarantool.org>
Subject: [tarantool-patches] Re: [PATCH] tarantoolctl: return an error on enter to a dead socket.
Date: Wed, 18 Jul 2018 08:19:53 +0300	[thread overview]
Message-ID: <20180718051953.GA31091@chai> (raw)
In-Reply-To: <20180716082655.42311-1-sergepetrenko@tarantool.org>

* Serge Petrenko <sergepetrenko@tarantool.org> [18/07/16 15:14]:

> Tarantoolctl enter didn't check whether connection to a socket was established
> if a socket file existed. It just executed a local console.
> Fix this by adding a check and an error, also add a test case.
> 
> Closes #3364

>  extra/dist/tarantoolctl.in         | 19 ++++++++++++-------
>  test/app-tap/tarantoolctl.test.lua | 29 ++++++++++++++++++++++++++++-
>  2 files changed, 40 insertions(+), 8 deletions(-)
> 
> +    local status, err = pcall(function()
> +        test:test("check error codes in case of enter", function(test_i)
> +            test_i:plan(6)
> +            check_ok(test_i, dir, 'enter', 'script', 1, nil, "Can't connect to")
> +            check_ok(test_i, dir, 'start', 'script', 0)
> +            os.execute(("kill $(cat %s/script.pid)"):format(dir))

I don't understand how this works. Simply sending
SIGTERM to tarantool would should it down gracefully and remove
the socket. If it doesn't, it's a bug. You should use SIGKILL if
you wanted to create a dead socket. But then again why do you need
to start an instance in order to get a dead socket? Can't you make
it simpler and create a dead socket with fio API?

> +            check_ok(test_i, dir, 'enter', 'script', 1, nil, "Can't connect to")
> +            check_ok(test_i, dir, 'stop','script', 0)
> +        end)
> +    end)

-- 
Konstantin Osipov, Moscow, Russia, +7 903 626 22 32
http://tarantool.io - www.twitter.com/kostja_osipov

  reply	other threads:[~2018-07-18  5:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-16  8:26 [tarantool-patches] " Serge Petrenko
2018-07-18  5:19 ` Konstantin Osipov [this message]
2018-07-18  9:19   ` [tarantool-patches] " Sergey Petrenko
2018-08-03  8:52     ` Sergey Petrenko

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=20180718051953.GA31091@chai \
    --to=kostja@tarantool.org \
    --cc=sergepetrenko@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='[tarantool-patches] Re: [PATCH] tarantoolctl: return an error on enter to a dead socket.' \
    /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