4

I run a long query (a two min long maybe) and the code crashes with a timeout error.

I don't use the Gremlin-Server, I directly connect to the Neptune End-point from my Python code.

For NEO4J I change the scriptEvaluationTimeout located at https://github.com/apache/tinkerpop/blob/master/gremlin-server/conf/gremlin-server-neo4j.yaml.

How should I change something similar for Neptune (when I do not use a Gremlin Server)

Traceback (most recent call last):
  File "test.py", line 18, in <module>
    print(execute_query(query))
  File "/home/ec2-user/app/ecodrone/ecodrone/base_gremlin.py", line 56, in execute_query
    results = future_results.result()
  File "/usr/lib64/python3.7/concurrent/futures/_base.py", line 432, in result
    return self.__get_result()
  File "/usr/lib64/python3.7/concurrent/futures/_base.py", line 384, in __get_result
    raise self._exception
  File "/usr/local/lib/python3.7/site-packages/gremlin_python/driver/resultset.py", line 81, in cb
    f.result()
  File "/usr/lib64/python3.7/concurrent/futures/_base.py", line 425, in result
    return self.__get_result()
  File "/usr/lib64/python3.7/concurrent/futures/_base.py", line 384, in __get_result
    raise self._exception
  File "/usr/lib64/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.7/site-packages/gremlin_python/driver/connection.py", line 77, in _receive
    self._protocol.data_received(data, self._results)
  File "/usr/local/lib/python3.7/site-packages/gremlin_python/driver/protocol.py", line 98, in data_received
    "{0}: {1}".format(status_code, message["status"]["message"]))
gremlin_python.driver.protocol.GremlinServerError: 598: {"requestId":"2b5511fe-4930-4d84-b685-dc3c9943d991","code":"TimeLimitExceeededException","detailedMessage":"A timeout occurred within the script during evaluation of [RequestMessage{, requestId=2b5511fe-4930-4d84-b685-dc3c9943d991, op='eval', processor='', args={gremlin=g.withSack(0).V().hasLabel(\"People\").as(\"from\",\"to\").\n                repeat(both().as(\"to\").dedup(\"from\",\"to\").\n                sack(sum).by(constant(1))).\n                emit(hasLabel(\"Process\")).\n                sack().dedup().fold().\n                project(\"min\", \"max\").\n                by(choose(count(local).is(0), constant(0), min(local))).\n                by(choose(count(local).is(0), constant(0), max(local))), aliases={g=g}}}] - consider increasing the timeout"}
Srinath Ganesh
  • 2,496
  • 2
  • 30
  • 60

1 Answers1

4

Neptune documentation describes a neptune_query_timeout - I would think that would help you:

https://docs.aws.amazon.com/neptune/latest/userguide/parameters.html

stephen mallette
  • 45,298
  • 5
  • 67
  • 135
  • The value of the timeout is set to 20s and this still happens. Is that unusual? Should the timeout be much longer? The operation is to add 50 vertices to the graph db. – Uche Ozoemena Apr 27 '22 at 08:26