This is an automated email from the ASF dual-hosted git repository.

qiaojialin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git


The following commit(s) were added to refs/heads/master by this push:
     new 593f3ad  fix close twice session bug (#1241)
593f3ad is described below

commit 593f3ad39ab90ce28d7046eb8f2e22b3251a7cc8
Author: Jialin Qiao <[email protected]>
AuthorDate: Fri May 22 16:37:05 2020 +0800

    fix close twice session bug (#1241)
    
    * fix close twice bug
---
 server/src/main/java/org/apache/iotdb/db/service/TSServiceImpl.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git 
a/server/src/main/java/org/apache/iotdb/db/service/TSServiceImpl.java 
b/server/src/main/java/org/apache/iotdb/db/service/TSServiceImpl.java
index 372098c..cec6b4e 100644
--- a/server/src/main/java/org/apache/iotdb/db/service/TSServiceImpl.java
+++ b/server/src/main/java/org/apache/iotdb/db/service/TSServiceImpl.java
@@ -230,7 +230,9 @@ public class TSServiceImpl implements TSIService.Iface, 
ServerContext {
   @Override
   public TSStatus closeSession(TSCloseSessionReq req) {
     logger.info("{}: receive close session", IoTDBConstant.GLOBAL_DB_NAME);
-    long sessionId = req.getSessionId();
+    long sessionId = currSessionId.get();
+    currSessionId.remove();
+
     TSStatus tsStatus;
     if (sessionIdUsernameMap.remove(sessionId) == null) {
       tsStatus = RpcUtils.getStatus(TSStatusCode.NOT_LOGIN_ERROR);

Reply via email to