Github user dkuppitz commented on a diff in the pull request:

    https://github.com/apache/tinkerpop/pull/570#discussion_r105754194
  
    --- Diff: 
gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngine.java
 ---
    @@ -149,19 +159,64 @@
             }
         };
     
    +    private GremlinGroovyClassLoader loader;
    +
         /**
          * Script to generated Class map.
          */
    -    private ManagedConcurrentValueMap<String, Class> classMap = new 
ManagedConcurrentValueMap<>(ReferenceBundle.getSoftBundle());
    +    private final LoadingCache<String, Future<Class>> classMap = 
Caffeine.newBuilder().
    +            softValues().
    +            recordStats().
    +            build(new CacheLoader<String, Future<Class>>() {
    +        @Override
    +        public Future<Class> load(final String script) throws Exception {
    +            final long start = System.currentTimeMillis();
    +
    +            return CompletableFuture.supplyAsync(() -> {
    +                try {
    +                    return loader.parseClass(script, generateScriptName());
    +                } catch (CompilationFailedException e) {
    +                    final long finish = System.currentTimeMillis();
    +                    log.error("Script compilation FAILED {} took {}ms {}", 
script, finish - start, e);
    +                    failedCompilationCount.incrementAndGet();
    --- End diff --
    
    This is a syntactically correct script. Did you try something like 
`g.V().butthead)(` or a huge script that runs into a compilation timeout?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to