[PATCH 0/4] Outdate disconnected session

Vladislav Shpilevoy v.shpilevoy at tarantool.org
Fri Dec 7 18:46:31 MSK 2018


Once a connection is closed, a long-running user request can not
learn about this occasion. Even box.sesion.push() still works and
on_disconnect triggers are not run.

This patch makes things simpler:

* disconnected session is marked as dead. So a user can determine
  if a connection is closed by looking at session type == 'dead',
  or checking for errors from box.session.push();

* on_disconnect triggers are run right after disconnect. Even if
  there are some active requests.

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):
  iproto: rename disconnect cmsg to destroy
  iproto: fire on_disconnect right after disconnect
  session: introduce 'dead' type
  session: kill a session of a closed connection

 src/box/iproto.cc         | 78 +++++++++++++++++++++++++++------------
 src/box/session.cc        |  2 +
 src/box/session.h         | 14 +++++++
 test/box/net.box.result   | 21 ++++++++---
 test/box/net.box.test.lua | 13 +++++--
 test/box/push.result      | 50 +++++++++++++++++++++++++
 test/box/push.test.lua    | 22 +++++++++++
 7 files changed, 169 insertions(+), 31 deletions(-)

-- 
2.17.2 (Apple Git-113)




More information about the Tarantool-patches mailing list