typedb-driver-python
typedb-driver-python copied to clipboard
Client-side timeout
Client-python does not set a client-side timeout, and will stall forever if the network gets interrupted
Grakn version: 1.5
Reproducible step:
- Start grakn:
grakn server start - Run the python-equivalent of the following Java queries using client-python:
try (GraknClient.Session session = new GraknClient("localhost:48555").session("grakn")) {
while (true) {
GraknClient.Transaction tx = session.transaction(Transaction.Type.WRITE);
tx.execute(Graql.match(var("x").sub("thing")).get());
System.out.println("query");
tx.commit();
}
}
- Pause grakn in the middle:
kill -STOP <grakn process id> - Observe that the queries will stall and never times out
TODO
- The client should be able to set a timeout when instantiating the client. We need to set a default, eg., 15 seconds.
client1 = new Grakn(DEFAULT_URI, 20) // timeout set to 20 seconds
client2 = new Grakn(DEFAULT_URI) // timeout set to the default timeout, eg., 15 seconds
- The provided timeout value should be used to set the deadline of GRPC requests.
We should re-test this issue now that 2.0.0 alpha is out.
Yes we should. This issue is really old but it's still worth testing right @alexjpwalker ?
Yes
I couldn't reproduce the issue locally. When I kill my server instance, the in-progress network call immediately terminates with an exception.
This is in line with what is expected from the current client architecture. Closing.