"RecursionError: maximum recursion depth exceeded in comparison" with Gremlin

463 views
Skip to first unread message

Faria Kalim

unread,
Jul 17, 2018, 8:14:33 PM7/17/18
to Gremlin-users
Hi,

I have a query that runs on a densely connected graph of about a 100 nodes. The query looks somewhat like this: 

graph_client.graph_traversal.V().hasLabel("a").\
has("id", job_id).repeat(out("connected").simplePath()).\
until(not_(outE("connected"))).path().dedup().toList()

However, the query always results in a crash that has a stack trace that looks like this:

ERROR | tornado.application | function: handle_callback_exception | line: 638 | Exception in callback functools.partial(<function wrap.<locals>.null_wrapper at 0x1097911e0>)
Traceback (most recent call last):
  File "~/.local/share/virtualenvs/caladrius-5FocEuMm/lib/python3.6/site-packages/tornado/ioloop.py", line 605, in _run_callback
    ret = callback()
  File "~/.local/share/virtualenvs/caladrius-5FocEuMm/lib/python3.6/site-packages/tornado/stack_context.py", line 277, in null_wrapper
    return fn(*args, **kwargs)
  File "~/.local/share/virtualenvs/caladrius-5FocEuMm/lib/python3.6/site-packages/tornado/iostream.py", line 562, in wrapper
    return callback(*args)
  File "~/.local/share/virtualenvs/caladrius-5FocEuMm/lib/python3.6/site-packages/tornado/stack_context.py", line 345, in wrapped
    raise_exc_info(exc)
  File "<string>", line 4, in raise_exc_info
  File "~/.local/share/virtualenvs/caladrius-5FocEuMm/lib/python3.6/site-packages/tornado/stack_context.py", line 316, in wrapped
    ret = fn(*args, **kwargs)
  File "~/.local/share/virtualenvs/caladrius-5FocEuMm/lib/python3.6/site-packages/tornado/websocket.py", line 869, in _on_frame_length_64
    self._read_frame_data(False)
  File "~/.local/share/virtualenvs/caladrius-5FocEuMm/lib/python3.6/site-packages/tornado/websocket.py", line 849, in _read_frame_data
    self._on_masked_frame_data if masked else self._on_frame_data)
  File "~/.local/share/virtualenvs/caladrius-5FocEuMm/lib/python3.6/site-packages/tornado/iostream.py", line 319, in read_bytes
    assert isinstance(num_bytes, numbers.Integral)
  File "~/.local/share/virtualenvs/caladrius-5FocEuMm/bin/../lib/python3.6/abc.py", line 184, in __instancecheck__
    if subclass in cls._abc_cache:
  File "~/.local/share/virtualenvs/caladrius-5FocEuMm/bin/../lib/python3.6/_weakrefset.py", line 75, in __contains__
    return wr in self.data
RecursionError: maximum recursion depth exceeded in comparison

On the client side, I get an error that looks like the following:
 File "~/.local/share/virtualenvs/caladrius-5FocEuMm/lib/python3.6/site-packages/gremlin_python/driver/protocol.py", line 69, in data_received
    message = self._message_serializer.deserialize_message(json.loads(message.decode('utf-8')))
AttributeError: 'NoneType' object has no attribute 'decode'

I know for a fact however, that the query works perfectly on a smaller graph of about 5 nodes. 

Any ideas on what might be causing the problem? 
 

Faria Kalim

unread,
Jul 17, 2018, 8:35:30 PM7/17/18
to Gremlin-users
The graph has 236 vertices and 1688 edges.

Faria Kalim

unread,
Jul 19, 2018, 2:27:22 AM7/19/18
to Gremlin-users
Would anyone happen to know how to setup an index for the vertices to see if that would improve the query's performance?

Stephen Mallette

unread,
Jul 19, 2018, 6:20:42 AM7/19/18
to Gremlin-users
Regarding your error, I don't know what that might be offhand. Does that traversal work properly when you run it in the Gremlin Console against your  236 vertices and 1688 edges graph?

As for your question about indices, it can't be specifically answered without knowing the graph that you are using, but certainly an index on "id" would theoretically improve the query, but for a graph with just 236 vertices I'm not sure you'll see much of a difference either way. 

--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/8a901e90-f210-4a4e-86ec-151f803404e8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Faria Kalim

unread,
Jul 19, 2018, 4:49:42 PM7/19/18
to Gremlin-users
Thank you for getting back to me. Although the graph size is small in terms of vertices, it is very densely connected. Is there a way to build an index on the edges that have a certain "connection"?

In addition, do you have any advice on how to import TinkerGraph.open() into python application (and not as a plugin in console)?

Lastly, I haven't been running it in the console. I need it to work as part of an application that I am writing. 

Thanks!

Stephen Mallette

unread,
Jul 20, 2018, 9:53:00 AM7/20/18
to Gremlin-users
 Is there a way to build an index on the edges that have a certain "connection"? 

Not with TinkerGraph - it doesn't have a notion of vertex-centric indices  

In addition, do you have any advice on how to import TinkerGraph.open() into python application (and not as a plugin in console)?

You can't - there is no TinkerGraph class in gremlin-python. You can only access a remotely configured TinkerGraph hosted in Gremlin Server. 

Still not sure of why you're getting that error in python, though my question still stands about how well the query works in Gremlin Console. If it works in the console then that means that we've isolated the problem to something in python.

Reply all
Reply to author
Forward
0 new messages