newbie master
newbie master

Reputation: 140

How do I set the query timeout using gremlin query for aws neptune?

I tried to use something like g.with_('evaluationTimeout', 1) but it does not seem to work

Upvotes: 0

Views: 1277

Answers (1)

Kelvin Lawrence
Kelvin Lawrence

Reputation: 14371

Assuming you are using one of the Gremlin GLV clients, then a query such as this one (Python in this case) will apply the per query timeout. Note that the longer form scriptEvaluationTimeout was deprecated in favor of the shorter form evaluationTimeout

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

or

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

If the query times out, you will get an exception that includes as message such as:

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

Upvotes: 2

Related Questions