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

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

Github user spmallette commented on the issue:

    https://github.com/apache/tinkerpop/pull/567
  
    I like this way better than the synchronization. I have some reservations 
about:
    
    ```java
    CompletableFuture.supplyAsync(() -> loader.parseClass(script, 
generateScriptName()));
    ```
    
    That's going to use the `ForkJoinPool` to execute the compilation, which is 
a shared thread pool for the JVM that isn't configurable and basically outside 
of our control. Of course, getting rid of it means adding a new 
`ExecutorService` that we can configure and monitor in 
`GremlinGroovyScriptEngine`.  Making that kind of change goes pretty deep into 
various aspects of TinkerPop. If @BrynCooke is ok with the changes I can merge 
what he has to a branch since it seems like we have general consensus on the 
approach and then make some additional changes and re-issue the PR for a final 
VOTE.  If there's no objections I'll start work on that first thing tomorrow.
    



> Improve script compilation syncronisation
> -----------------------------------------
>
>                 Key: TINKERPOP-1644
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-1644
>             Project: TinkerPop
>          Issue Type: Improvement
>          Components: groovy
>    Affects Versions: 3.2.4
>            Reporter: Bryn Cooke
>
> Currently there is no synchronisation around script compilation. This means 
> that if a particularly heavy script is in use, many threads may end up 
> compiling the same script.
> It would seem like a good idea to have some some sort of synchronisation to 
> prevent ever getting to this stage.
> In addition, there will be cases where users will repeatedly submit broken 
> scripts to the server. In this case it is useful to log the error the first 
> time the script compilation is attempted and then cache the error for 
> subsequent runs.
> Finally I have found some scripts take in excess of 30 seconds to compile. To 
> aid performance debugging the script compilation times should be included in 
> the logs.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to