nebula-python==1.1.1.post1客户端连接Nebula隔一段时间会连接会报Transport not open

  • nebula 版本:1.2.0

  • 部署方式:分布式(线上),单机 (开发服),都出现这种情况

  • 是否为线上版本:Y

  • 问题的具体描述
    连接一段时间之后就会出现客户端连接关闭,客户端执行reconnect之后就能恢复,是否是graphd对命令执行报错多次之后的保护机制

  • 服务端没有异常

  • python客户端请求报错日志

[2021-08-08 13:47:16] [error] [server.py - 70 - wrapper] Catch Error: uuid: 141e41ea-f80c-11eb-ab58-00163e13ce60, func_name: search_human_recommendation_by_nebula, err_msg: Traceback (most recent call last):
  File "/root/ironforge/Ironforge/venv/lib/python3.5/site-packages/nebula/Client.py", line 114, in execute_query
    return self._client.execute(self._session_id, statement)
  File "/root/ironforge/Ironforge/venv/lib/python3.5/site-packages/nebula/graph/GraphService.py", line 701, in execute
    self.send_execute(sessionId, stmt)
  File "/root/ironforge/Ironforge/venv/lib/python3.5/site-packages/nebula/graph/GraphService.py", line 711, in send_execute
    self._oprot.trans.flush()
  File "/root/ironforge/Ironforge/venv/lib/python3.5/site-packages/nebula/fbthrift/transport/TTransport.py", line 196, in flush
    self.__trans.write(out)
  File "/root/ironforge/Ironforge/venv/lib/python3.5/site-packages/nebula/fbthrift/transport/TSocket.py", line 312, in write
    'Transport not open')
nebula.fbthrift.transport.TTransport.TTransportException: Transport not open

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "server.py", line 65, in wrapper
    result = func(*args, **kwargs)
  File "/root/ironforge/Ironforge/app.py", line 6763, in search_human_recommendation_by_nebula
    graph_client, self.target_enterprise_customer_repository, es_client, self.human_col, keyword, my_company_name, human_ids,enterprise_ids,school_ids, start, size)
  File "/root/ironforge/Ironforge/logic/human.py", line 1272, in logic_search_human_recommendation_by_nebula
    total,rs = search_human_recommendation(graph_client, repo, my_enterprise_id, human_ids, enterprise_ids, school_ids, start, size)
  File "/root/ironforge/Ironforge/graph_service/human.py", line 641, in search_human_recommendation
    resp = graph_client.execute_query(my_colleague_ngql)
  File "/root/ironforge/Ironforge/venv/lib/python3.5/site-packages/nebula/Client.py", line 117, in execute_query
    raise ExecutionException("Execute `{}' failed: {}".format(statement, x))
nebula.Common.ExecutionException: Execute `
    go from hash('N2Iv6NQFNh8=') over human_enterprise_member,human_enterprise_legal_represent reversely 
    yield distinct $$.human.humanId as human_id,$$.human.tungeeRank as tungeeRank 
    | order by tungeeRank desc;
    ' failed: Transport not open

这个应该是你们客户端和服务端的连接长时间没有交互,idle时间过长,然后连接断开了,这不是服务端的机制,这和你们部署网络的配置有关。当出现连接idle时间过长,你可以在客户端那边进行重连恢复就好,和服务端的配置没有关系。

1 个赞

明白了 多谢!

此话题已在最后回复的 30 天后被自动关闭。不再允许新回复。