微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

gremlin python 超时问题:gremlin_python.driver.protocol.GremlinServerError

如何解决gremlin python 超时问题:gremlin_python.driver.protocol.GremlinServerError

我无法解决从 Cosmos 图形数据库读取和获取数据时的超时问题。

我已尝试使用以下配置和设置。

gremlinpython - 3.5.0 Aiohttp传输

client = client.Client('wss://host/','g',username="DB_Details",password="pwd",message_serializer=serializer.GraphSONSerializersV2d0(),max_content_length = 1000 * 1024 * 1024 * 1024
transport_factory=lambda: AiohttpTransport(read_timeout=5000000,write_timeout=5000000))

上面的代码在遍历大约 30 万个节点时给了我错误错误是 gremlin_python.driver.protocol.GremlinServerError: 598。

甚至尝试将 Tornado 用于 gremlinpython 3.4.9 客户端,这也给了我同样的错误

client = client.Client('wss://host/',transport_factory=lambda: TornadoTransport(read_timeout=5000000,write_timeout=5000000))

以下是回溯:

Code: 598,Attributes: {'x-ms-status-code': 1009,'x-ms-request-charge': 3260.27,'x-ms-total-request-charge': 119342.83599999994,'x-ms-server-time-ms': 2210.0139,'x-ms-total-server-time-ms': 60034.249399999986,'x-ms-activity-id': '0e785d70-ef42-4e00-b223-588b86babeae'}
Request timeout error!
Traceback (most recent call last):
  File "/Users/lokesh/PycharmProjects/pythonProject/test.py",line 101,in <module>
    results = gremlinconnections(client,allEdges)
  File "/Users/lokesh/PycharmProjects/pythonProject/test.py",line 58,in gremlinconnections
    callback_results = callback.result().all().result()
  File "/Library/Developer/CommandLinetools/Library/Frameworks/python3.framework/Versions/3.8/lib/python3.8/concurrent/futures/_base.py",line 439,in result
    return self.__get_result()
  File "/Library/Developer/CommandLinetools/Library/Frameworks/python3.framework/Versions/3.8/lib/python3.8/concurrent/futures/_base.py",line 388,in __get_result
    raise self._exception
  File "/Users/lokesh/Library/Python/3.8/lib/python/site-packages/gremlin_python/driver/resultset.py",line 90,in cb
    f.result()
  File "/Library/Developer/CommandLinetools/Library/Frameworks/python3.framework/Versions/3.8/lib/python3.8/concurrent/futures/_base.py",line 432,in __get_result
    raise self._exception
  File "/Library/Developer/CommandLinetools/Library/Frameworks/python3.framework/Versions/3.8/lib/python3.8/concurrent/futures/thread.py",line 57,in run
    result = self.fn(*self.args,**self.kwargs)
  File "/Users/lokesh/Library/Python/3.8/lib/python/site-packages/gremlin_python/driver/connection.py",line 83,in _receive
    status_code = self._protocol.data_received(data,self._results)
  File "/Users/lokesh/Library/Python/3.8/lib/python/site-packages/gremlin_python/driver/protocol.py",line 112,in data_received
    raise GremlinServerError(message["status"])
gremlin_python.driver.protocol.GremlinServerError: 598:

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。