You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tinkerpop.apache.org by "Konstantin Müller (JIRA)" <ji...@apache.org> on 2017/08/29 13:54:00 UTC
[jira] [Created] (TINKERPOP-1761) GremlinExecutor: Timeout future
not cancelled on successful script evaluation
Konstantin Müller created TINKERPOP-1761:
--------------------------------------------
Summary: GremlinExecutor: Timeout future not cancelled on successful script evaluation
Key: TINKERPOP-1761
URL: https://issues.apache.org/jira/browse/TINKERPOP-1761
Project: TinkerPop
Issue Type: Bug
Affects Versions: 3.2.6
Reporter: Konstantin Müller
This bug seems to be introduced by TINKERPOP-1714. The timeout future in GremlinExecutor.eval() is not cancelled when the evaluation future is completed successfully before the timeout (lines 304ff). This was done correctly before the changes introduced by TINKERPOP-1714. Code to reproduce:
{code:java}
try (GremlinExecutor executor = GremlinExecutor.build().scriptEvaluationTimeout(15_000).create()) {
executor.eval("1+1").get();
} catch (Exception e) {
// NOOP
}
{code}
When the code leaves the try-block it calls GremlinExecutor.close() which will clean up executorService and scheduledExecutorService, but because the timeout future is not cancelled this will hang until the future is finished (here 15s).
Workaround: Provide an own ExecutorService when constructing a GremlinExecutor instance and cancel all tasks when the script evaluation is finished successfully.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)