Skip to content

Conversation

@liujiajun
Copy link
Contributor

@liujiajun liujiajun commented Jul 1, 2021

Users may forget to close sessions. Such idle connections lead to a waste of server resource and in the worst case, take up all the memory of server. To solve this problem, we would like to introduce session timeout.

Design

SessionTimeoutManager manages the lifecycle of all sessions. It keeps track of the last active time of the sessions
and periodically checks if the current running sessions have timed out. Specifically, if a session has been idle for a configurable period of time, SessionTimeoutManager will consider it as timed out and ends the session forcibly.

Session timeouts are refreshed under the following scenarios:

  • checkLogin is called. Effectively, session timeout is refreshed whenever a new query/non-query operations comes in.
  • long query is unregistered in QueryTimeManager.

liujiajun added 11 commits June 16, 2021 21:41
… # server/src/main/java/org/apache/iotdb/db/qp/constant/SQLConstant.java # server/src/main/java/org/apache/iotdb/db/qp/logical/Operator.java # server/src/main/java/org/apache/iotdb/db/qp/sql/IoTDBSqlVisitor.java
… # server/src/main/java/org/apache/iotdb/db/qp/constant/SQLConstant.java # server/src/main/java/org/apache/iotdb/db/qp/logical/Operator.java # server/src/main/java/org/apache/iotdb/db/qp/sql/IoTDBSqlVisitor.java
…-manager

# Conflicts:
#	server/src/main/java/org/apache/iotdb/db/query/control/SessionManager.java
#	server/src/main/java/org/apache/iotdb/db/service/TSServiceImpl.java
@coveralls
Copy link

coveralls commented Jul 1, 2021

Coverage Status

Coverage decreased (-0.02%) to 67.915% when pulling 913ab16 on liujiajun:session-manager into 38149a4 on apache:master.

@liujiajun liujiajun changed the title [WIP] Session timeout Session timeout Jul 5, 2021
@Alima777 Alima777 merged commit f7bf886 into apache:master Jul 5, 2021
@liujiajun liujiajun changed the title Session timeout Implement session timeout Jul 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants