【问题标题】:How do I set the query timeout using gremlin query for aws neptune?如何使用 gremlin 查询 aws neptune 设置查询超时?
【发布时间】:2021-10-15 15:57:45
【问题描述】:

我尝试使用 g.with_('evaluationTimeout', 1) 之类的东西,但它似乎不起作用

【问题讨论】:

  • “它似乎不起作用” - 不具体。到底发生了什么?
  • 您使用的是哪个 Gremlin 客户端驱动程序,版本号是多少?
  • @Marcin 我执行了命令,但没有得到预期的超时,只是得到了结果。可能是查询不到 1 毫秒?我在超时时间里放了 1 毫秒
  • @KelvinLawrence 最新的一个
  • 也许尝试更复杂的查询只是为了确定。您使用的是 Python 客户端还是 Gremlin 控制台或其他什么?

标签: amazon-web-services gremlin amazon-neptune


【解决方案1】:

假设您使用的是 Gremlin GLV 客户端之一,那么诸如此类的查询(在本例中为 Python)将应用每次查询超时。请注意,较长的形式 scriptEvaluationTimeout 已被弃用,取而代之的是较短的形式 evaluationTimeout

g.with_('scriptEvaluationTimeout',5).V().count().next()

g.with_('evaluationTimeout',5).V().count().next()

如果查询超时,您将收到一个异常,其中包含如下消息:

gremlin_python.driver.protocol.GremlinServerError: 500: 
{"detailedMessage":"A timeout occurred within the script during evaluation.","code":"TimeLimitExceededException","requestId":"9ec1e462-f47f-4876-8157-c0bf3c06ec6b"}

【讨论】:

  • withwith_有什么区别吗?
  • with_ 是因为我使用 Python 进行测试,with 是 Python 中的保留字,所以 Gremlin 客户端使用 with_
猜你喜欢
  • 1970-01-01
  • 2018-06-03
  • 1970-01-01
  • 2021-06-05
  • 1970-01-01
  • 2021-11-09
  • 1970-01-01
  • 1970-01-01
  • 2021-10-06
相关资源
最近更新 更多