From 8969e7b55391caa7619cc61771dacee4fa756d55 Mon Sep 17 00:00:00 2001 From: Anqi Date: Fri, 24 May 2024 10:54:16 +0800 Subject: [PATCH] fix --- nebula3/gclient/net/Session.py | 1 - nebula3/gclient/net/SessionPool.py | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/nebula3/gclient/net/Session.py b/nebula3/gclient/net/Session.py index a43949a0..069c38f8 100644 --- a/nebula3/gclient/net/Session.py +++ b/nebula3/gclient/net/Session.py @@ -297,7 +297,6 @@ def release(self): return self._connection.signout(self._session_id) self._connection.is_used = False - self._connection.close() self._connection = None def ping(self): diff --git a/nebula3/gclient/net/SessionPool.py b/nebula3/gclient/net/SessionPool.py index 5cfe9813..77db1d20 100644 --- a/nebula3/gclient/net/SessionPool.py +++ b/nebula3/gclient/net/SessionPool.py @@ -425,9 +425,11 @@ def _new_session(self): resp = session.execute("USE {}".format(self._space_name)) except Exception: session.release() + connection.close() raise if not resp.is_succeeded(): session.release() + connection.close() raise RuntimeError( "Failed to get session, cannot set the session space to {} error: {} {}".format( self._space_name, resp.error_code(), resp.error_msg()