Gremlin Python Client - premature timeout in 3.4.9 - issue and a workaround

631 views
Skip to first unread message

Kelvin Lawrence

unread,
Jan 14, 2021, 11:31:19 AM1/14/21
to Gremlin-users
There is an issue in the 3.4.9 version of the Gremlin Python client where no matter what value is in place for server side timeouts, the client itself will always timeout at 30 seconds if a query runs for that long. 

An issue has been opened. There is also a short term workaround. See the issue for the full details .https://issues.apache.org/jira/browse/TINKERPOP-2505 

In the 3.4.9 client, two new parameters read_timeout and write_timeout were added to the Tornado connection configuration with default values of 30 seconds. This was actually done to address this issue https://issues.apache.org/jira/browse/TINKERPOP-2405 but the default values really should have been set to None. 

The workaround is to set them to None in your own code or to revert to the 3.4.8 client.

Here is a code snippet showing the extra import you need and the way to disable this 30 second client side timeout.

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)

Stephen Mallette

unread,
Jan 14, 2021, 1:51:36 PM1/14/21
to gremli...@googlegroups.com
I've pushed a fix for this issue here;


One silly line of code technically....sorry about that folks.

--
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/7fb694a4-b0da-49bd-931f-1d3675e59e88n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages