[tarantool-patches] Re: [PATCH 3/4] session: introduce 'dead' type

Vladislav Shpilevoy v.shpilevoy at tarantool.org
Fri Dec 7 23:40:29 MSK 2018



On 07/12/2018 20:38, Konstantin Osipov wrote:
> * Vladislav Shpilevoy <v.shpilevoy at tarantool.org> [18/12/07 18:48]:
>> If an iproto connection is closed, there are no way
>> how to determine if this happened. Except setting an
>> on_disconnect trigger which sets a global flag or
>> something.
>>
>> To deal with such orphan requests a new session type
>> is introduced that can be checked inside a request.
> 
> Please don't reset session type when it becomes dead.
> What's the problem with storing an explicit vtab pointer in the
> session and resetting it?

I've explained to you what is a problem. To store vtab in struct
session we should reset its type never, since vtab now depends
both on type and on session state. But we can not do it because of
repl and console session types which are reset in src/lua/init.c and
src/lua/console.lua. Moreover, we can not set a session type repl
at start of the lua script runner, since it is in src/ but session
is in box/.

Also, I can turn background session type into console one via
require('console').start(), and this case it impossible to
determine at start of a fiber.

So the simplest ways to solve #3859 are 1) introduce 'dead' session
as we discussed with Vova, 2) just add an explicit check into
iproto session push implementation that a session is still connected.

Also we can move struct session into src/ but it is a long and complex
way that should be discussed.

>>
>> Needed for #3859
>> ---
>>   src/box/session.cc |  2 ++
>>   src/box/session.h  | 14 ++++++++++++++
>>   2 files changed, 16 insertions(+)
>>
> 



More information about the Tarantool-patches mailing list