如何使gremlin_python DriverRemoteConnection对每个提交都有超时和重试限制? [英] How to make gremlin_python DriverRemoteConnection to have timeout and retry limit for each submit?

查看:93
本文介绍了如何使gremlin_python DriverRemoteConnection对每个提交都有超时和重试限制?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

免责声明:我们目前正在使用 gremlinpython == 3.4.8 ,我相信其中的一些已在较新的发行版中得到解决,但我不确定.总的来说,这似乎是一个非常活跃的存储库,在过去的两个最新发行日志(当前为3.4.10)中进行了一些相关更改.很高兴根据需要进行升级.

Disclaimer: We are currently using gremlinpython==3.4.8 and I believe some of this has been addressed in the more recent releases but I'm not sure. In general this seems like a very active repository with some relevant changes in the past two latest release logs (currently on 3.4.10). Happy to upgrade as needed.

文档在哪里,或者您可以提供一个实例化具有适当配置的DriverRemoteConnection对象的示例,以允许通过 NUM_RETRIES 次重试来重试每个查询提交?

Where is the documentation, or can you provide an example of instantiating a DriverRemoteConnection object that has the appropriate configuration to allow for retrying each query submission with NUM_RETRIES number of retries?

我不确定这些选项中的哪个选项适用于获得我想要的行为. https://tinkerpop.apache.org/docs/current/reference/#python配置

I am not sure which of these options applies in order to get the kind of behavior I want. https://tinkerpop.apache.org/docs/current/reference/#python-configuration

也许有意义的是重写 submit 方法

Maybe what makes sense is to override the submit method

我们当前如何实例化 DriverRemoteConnection 对象的示例:

Examples of how we currently instantiate DriverRemoteConnection object:

  gremlin_python.process.anonymous_traversal import traversal
  connection_object = traversal().withRemote(CONNECTION_STRING)

推荐答案

文档在哪里,或者您可以提供一个实例化具有适当配置的DriverRemoteConnection对象的示例,以允许通过NUM_RETRIES次重试来重试每个查询提交?

Where is the documentation, or can you provide an example of instantiating a DriverRemoteConnection object that has the appropriate configuration to allow for retrying each query submission with NUM_RETRIES number of retries?

没有这样的配置.即使对于TinkerPop存储库中功能最强大的Java驱动程序,也没有这种功能.请求重试需要特定于应用程序的编程,因为服务器错误消息和代码当前尚未统一(请参见 TINKERPOP-2517 ).因此,根据您选择的图形数据库,您需要确定要重试的错误代码和/或消息,然后自己编写此类应用程序逻辑.希望这可以澄清TinkerPop的位置和驱动程序的功能.

There is no such configuration. Even for the Java driver, which is the most featured driver in the TinkerPop repository, there is no such feature. Request retries require application specific programming as server error messages and codes are not currently unified (see TINKERPOP-2517). Therefore, depending on the graph database you have chosen you would need to determine what error codes and/or messages you would retry on and code such application logic yourself. Hopefully that clarifies TinkerPop's position and the features of the drivers.

这篇关于如何使gremlin_python DriverRemoteConnection对每个提交都有超时和重试限制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆