From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
To: tarantool-patches@freelists.org
Cc: vdavydov.dev@gmail.com
Subject: [PATCH v2 0/4] Outdate binary session on disconnect
Date: Tue, 11 Dec 2018 19:10:19 +0300 [thread overview]
Message-ID: <cover.1544544183.git.v.shpilevoy@tarantool.org> (raw)
Once a connection is closed, a user can learn it using
on_disconnect triggers. But session methods still work:
session.fd() returns socket fd, session.sync() returns request
sync, session.push() realy writes data to obuf and sends it to
iproto thread.
The goal of this patchset is to help user detect session
disconnect even without setting on_disconnect triggers. Patchset
makes a session, whose socket is closed, rotten. It returns an
error on push, -1 on fd, 0 on sync.
This is reached via moving struct session_vtab from a global
array to struct session and changing the vtab on disconnect.
V1: https://www.freelists.org/post/tarantool-patches/PATCH-04-Outdate-disconnected-session
Changes in v2:
- Store vtab in struct session, remove session_vtab_registry;
- Do not change session type on disconnect. Only vtab.
Branch: http://github.com/tarantool/tarantool/tree/gerold103/gh-3859-outdate-session-on-disconnect
Issue: https://github.com/tarantool/tarantool/issues/3859
Vladislav Shpilevoy (4):
console: forbid arbitrary session type setting
session: minimize number of session type resets
session: store vtab in struct session
session: outdate a session of a closed connection
src/box/applier.cc | 6 +++-
src/box/iproto.cc | 77 +++++++++++++++++++++++++++++------------
src/box/lua/console.c | 15 ++++----
src/box/lua/console.lua | 4 +--
src/box/lua/session.c | 26 ++++++++++----
src/box/session.cc | 19 ++++------
src/box/session.h | 29 +++++++++++-----
test/box/push.result | 50 ++++++++++++++++++++++++++
test/box/push.test.lua | 22 ++++++++++++
9 files changed, 186 insertions(+), 62 deletions(-)
--
2.17.2 (Apple Git-113)
next reply other threads:[~2018-12-11 16:10 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-11 16:10 Vladislav Shpilevoy [this message]
2018-12-11 16:10 ` [PATCH v2 1/4] console: forbid arbitrary session type setting Vladislav Shpilevoy
2018-12-21 11:17 ` Vladimir Davydov
2018-12-11 16:10 ` [PATCH v2 2/4] session: minimize number of session type resets Vladislav Shpilevoy
2018-12-11 16:10 ` [PATCH v2 3/4] session: store vtab in struct session Vladislav Shpilevoy
2018-12-21 11:04 ` Vladimir Davydov
2018-12-21 11:23 ` [tarantool-patches] " Vladislav Shpilevoy
2018-12-11 16:10 ` [PATCH v2 4/4] session: outdate a session of a closed connection Vladislav 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=cover.1544544183.git.v.shpilevoy@tarantool.org \
--to=v.shpilevoy@tarantool.org \
--cc=tarantool-patches@freelists.org \
--cc=vdavydov.dev@gmail.com \
--subject='Re: [PATCH v2 0/4] Outdate binary session on disconnect' \
/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