从使用python连接nebula提供flask接口服务报错继续讨论:
- nebula 版本 2.6.1
- 部署方式:分布式
- 安装方式: Docker
def __init__(
self,
ip: str = "10.1.1.248",
port: int = 9669,
name: str = "***",
password: str = "***",
space: str = "demo",
):
config = Config()
config.max_connection_pool_size = 128
connection_pool = ConnectionPool()
connection_pool.init(addresses=[(ip, port)], configs=config)
self.session = connection_pool.get_session(user_name=name, password=password)
...
def run(self, command: str):
status = self.session.execute(command)
if status.is_succeeded():
return status
elif status.error_msg() != "Existed!":
print(status.error_msg())
print(command)
return False
self.session.release()
初步怀疑是同一个session长时间没有使用,自动释放了,请问下是不是有这种情况?
用Python调用的时候需要每次建session吗?