0

I have a database with about 2 million nodes and transaction connections stored in a Neptune database.

I am trying two different queries with similar issues but I don't know how to solve any of them.

The first query is trying to generate a 2 hop graph starting from one user. The query is g.V(source).outE('friend').otherV().outE('friend').toList(). For a 1 hop graph, the query works fine, but for 2 hops or more I have the following error:

gremlin_python.driver.protocol.GremlinServerError: 598: {"detailedMessage":"A timeout occurred within the script or was otherwise cancelled directly during evaluation of [1e582e78-bab5-462c-9f24-5597d53ef02f]","code":"TimeLimitExceededException","requestId":"1e582e78-bab5-462c-9f24-5597d53ef02f"}

The second query I am making is finding a path (does not need to be the shortest but just a path) from a source node to a target node. The query to do this is the following: g.V().hasId(str(source)).repeat(__.out().simplePath()).until(__.hasId(str(target))).path().limit(1).toList()

The query works for pairs of nodes that are relatively close (at most 4 hops of distance) but for further apart pairs of nodes I am getting the following error:

*** tornado.ioloop.TimeoutError: Operation timed out after 30 seconds

I was wondering if anyone might have suggestions on how to solve these Time limit errors. I would really appreciate any help with this, thanks!

Stanislav Kralin
  • 11,070
  • 4
  • 35
  • 58
user110320
  • 121
  • 6

1 Answers1

2

This is a known bug in TinkerPop Python 3.4.9 client. Please see the thread on Gremlin mailing list for details of the issue and the workaround:

https://groups.google.com/g/gremlin-users/c/K0EVG3T-UrM

You can change the 30sec timeout using the following code snippet.

from gremlin_python.driver.tornado.transport import TornadoTransport

graph=Graph()

connection = DriverRemoteConnection(endpoint,'g',
                 transport_factory=lambda: TornadoTransport(read_timeout=None, write_timeout=None))

g = graph.traversal().withRemote(connection)
Divij
  • 878
  • 2
  • 9
  • 18