Tarantool development patches archive
 help / color / mirror / Atom feed
* [PATCH v3 0/2] Outdate binary session on disconnect
@ 2018-12-21 16:48 Vladislav Shpilevoy
  2018-12-21 16:48 ` [PATCH v3 1/2] session: store vtab both in struct and registry Vladislav Shpilevoy
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Vladislav Shpilevoy @ 2018-12-21 16:48 UTC (permalink / raw)
  To: tarantool-patches; +Cc: vdavydov.dev

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
V2: https://www.freelists.org/post/tarantool-patches/PATCH-v2-04-Outdate-binary-session-on-disconnect

Changes in v2:
- Store vtab in struct session, remove session_vtab_registry;
- Do not change session type on disconnect. Only vtab.

Changes in v3:
- Keep session_vtab_registry.

Branch: http://github.com/tarantool/tarantool/tree/gerold103/gh-3859-outdate-session-on-disconnect
Issue: https://github.com/tarantool/tarantool/issues/3859

Vladislav Shpilevoy (2):
  session: store vtab both in struct and registry
  session: outdate a session of a closed connection

 src/box/applier.cc     |  5 ++++-
 src/box/errcode.h      |  2 +-
 src/box/iproto.cc      |  9 +++++---
 src/box/lua/session.c  |  3 ++-
 src/box/session.cc     | 33 +++++++++++++++++++++++++++-
 src/box/session.h      | 19 +++++++++++++---
 test/box/misc.result   |  1 +
 test/box/push.result   | 50 ++++++++++++++++++++++++++++++++++++++++++
 test/box/push.test.lua | 22 +++++++++++++++++++
 9 files changed, 134 insertions(+), 10 deletions(-)

-- 
2.17.2 (Apple Git-113)

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-12-24 10:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-21 16:48 [PATCH v3 0/2] Outdate binary session on disconnect Vladislav Shpilevoy
2018-12-21 16:48 ` [PATCH v3 1/2] session: store vtab both in struct and registry Vladislav Shpilevoy
2018-12-21 16:48 ` [PATCH v3 2/2] session: outdate a session of a closed connection Vladislav Shpilevoy
2018-12-24 10:07 ` [PATCH v3 0/2] Outdate binary session on disconnect Vladimir Davydov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox