I tried to use something like g.with_('evaluationTimeout', 1)
but it does not seem to work
Asked
Active
Viewed 626 times
0

newbie master
- 130
- 9
-
"it does not seem to work" - is not specific. What exactly is happening? – Marcin Aug 12 '21 at 11:28
-
Which Gremlin client driver are you using and what is the version number? – Kelvin Lawrence Aug 12 '21 at 11:57
-
@Marcin I execute the command but I don't get a timeout as I expect and just the result. Could be that the query is taking less than 1 ms? I put 1ms in the timeout – newbie master Aug 12 '21 at 15:50
-
@KelvinLawrence latest one – newbie master Aug 12 '21 at 15:50
-
Perhaps try a more complicated query just to make sure. Are you using the Python client or the Gremlin Console or something else? – Kelvin Lawrence Aug 12 '21 at 18:05
1 Answers
2
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"}

Kelvin Lawrence
- 14,674
- 2
- 16
- 38
-
-
1The `with_` is because I used Python for testing and `with` is a reserved word in Python so the Gremlin client uses `with_` instead. – Kelvin Lawrence Aug 12 '21 at 18:04