Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladimir Davydov <vdavydov.dev@gmail.com>
To: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
Cc: tarantool-patches@freelists.org
Subject: Re: [PATCH 1/5] session: forbid creation from Lua binary and applier sessions
Date: Tue, 20 Mar 2018 16:20:08 +0300	[thread overview]
Message-ID: <20180320132008.sql5vzqx2tc6ovu3@esperanza> (raw)
In-Reply-To: <d54f0c011f80a39721dd19b69aef80ff487fb2d8.1521466428.git.v.shpilevoy@tarantool.org>

On Mon, Mar 19, 2018 at 04:34:48PM +0300, Vladislav Shpilevoy wrote:
> Lua has no access to applier or binary sockets, and these session
> types must be forbidden.
> 
> And after #2667 applier, binary, console and background session
> owners will be incapsulated inside corresponding modules.

I don't understand why we should explicitly check session type in this
funciton. After all, it's an internal function, never intended to be
called directly by the user, so why should we care?

> diff --git a/test/box-tap/session.test.lua b/test/box-tap/session.test.lua
> index 6fddced3c..ff952fd45 100755
> --- a/test/box-tap/session.test.lua
> +++ b/test/box-tap/session.test.lua
> @@ -15,14 +15,22 @@ session = box.session
>  space = box.schema.space.create('tweedledum')
>  index = space:create_index('primary', { type = 'hash' })
>  
> -test:plan(53)
> +test:plan(55)
> +
> +--
> +-- Check that can start from Lua only either console or REPL.
> +--
> +local ok, err = pcall(box.internal.session.create, 100, "binary")
> +test:is(err, "Can not start non-console or non-REPL session from Lua", "bad session type")
> +ok, err = pcall(box.internal.session.create, 100, "applier")
> +test:is(err, "Can not start non-console or non-REPL session from Lua", "bad session type")

  reply	other threads:[~2018-03-20 13:20 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-19 13:34 [PATCH 0/5] session: introduce box.session.push Vladislav Shpilevoy
2018-03-19 13:34 ` [PATCH 1/5] session: forbid creation from Lua binary and applier sessions Vladislav Shpilevoy
2018-03-20 13:20   ` Vladimir Davydov [this message]
2018-03-20 13:46     ` v.shpilevoy
2018-03-19 13:34 ` [PATCH 2/5] lua: port console yaml formatting to C Vladislav Shpilevoy
2018-03-20 17:51   ` Vladimir Davydov
2018-03-20 18:04     ` v.shpilevoy
2018-03-21  9:14       ` Vladimir Davydov
2018-03-21  9:30         ` v.shpilevoy
2018-03-19 13:34 ` [PATCH 3/5] Remove empty function declaration Vladislav Shpilevoy
2018-03-20 17:55   ` Vladimir Davydov
2018-03-20 17:57     ` [tarantool-patches] " v.shpilevoy
2018-03-21  9:16       ` Vladimir Davydov
2018-03-19 13:34 ` [PATCH 4/5] session: introduce session_owner Vladislav Shpilevoy
2018-03-20 18:29   ` Vladimir Davydov
2018-03-19 13:34 ` [PATCH 5/5] session: introduce box.session.push Vladislav Shpilevoy
2018-03-21  9:10   ` Vladimir Davydov
2018-03-21  9:30     ` [tarantool-patches] " v.shpilevoy
2018-03-21 12:25       ` Vladimir Davydov
2018-03-19 13:41 ` [tarantool-patches] [PATCH 0/5] " v.shpilevoy

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=20180320132008.sql5vzqx2tc6ovu3@esperanza \
    --to=vdavydov.dev@gmail.com \
    --cc=tarantool-patches@freelists.org \
    --cc=v.shpilevoy@tarantool.org \
    --subject='Re: [PATCH 1/5] session: forbid creation from Lua binary and applier sessions' \
    /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