[ 
https://issues.apache.org/jira/browse/TINKERPOP-1761?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16164674#comment-16164674
 ] 

ASF GitHub Bot commented on TINKERPOP-1761:
-------------------------------------------

Github user spmallette commented on the issue:

    https://github.com/apache/tinkerpop/pull/709
  
    @ko-mueller thanks for submitting this. I just wanted to let you know that 
it may take some time to get this merged. Every time this area of code gets 
changed there is suffering, so I'd like to be sure adding this code back 
doesn't create some new subtle issue that we solved with TINKERPOP-1714.


> 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
>          Components: groovy
>    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)

Reply via email to