Uploaded image for project: 'TinkerPop'
  1. TinkerPop
  2. TINKERPOP-1761

GremlinExecutor: Timeout future not cancelled on successful script evaluation

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.2.6
    • 3.2.7, 3.3.1
    • groovy
    • None

    Description

      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:

      try (GremlinExecutor executor = GremlinExecutor.build().scriptEvaluationTimeout(15_000).create()) {
        executor.eval("1+1").get();
      } catch (Exception e) {
        // NOOP
      }
      

      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.

      Attachments

        Issue Links

          Activity

            People

              spmallette Stephen Mallette
              komueller Konstantin Müller
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: