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

stephen mallette commented on TINKERPOP3-696:
---------------------------------------------

forgot to answer your final question regarding the cost of opening new 
sessions.  i'm not sure i've quantified that, but it obviously comes withe any 
expense of the init script being executed for each session.  that's easy enough 
to think about.  there will be one script cache per scriptengine so that will 
increase memory requirements.  as a result, if the same script is executed in 
each session you will pay the compilation cost for each session it is executed 
in.  Each session will require its own thread pool with a single thread in it - 
this ensures that transactional boundaries are managed properly from one 
request to the next.  i guess those would be the main things to think about.

> Gremlin-server running gremlin-groovy[scripts] on new session
> -------------------------------------------------------------
>
>                 Key: TINKERPOP3-696
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP3-696
>             Project: TinkerPop 3
>          Issue Type: Improvement
>          Components: server
>            Reporter: Dylan Millikin
>            Assignee: stephen mallette
>            Priority: Minor
>             Fix For: 3.0.0.GA
>
>
> Hey,
> I don't know if this is expected behavior, it seems like it may be but on the 
> off chance it isn't : When sending a request to gremlin-server with 
> {{opProcessor = 'session'}} the session is properly created but the 
> initializing scripts set in the {{gremlin-server.yaml}} configuration are run 
> every time. Resulting in the following warning:
> {code}[WARN] GremlinExecutor - Could not initialize gremlin-groovy 
> ScriptEngine with scripts/generate-classic.groovy as script could not be 
> evaluated - javax.script.ScriptException: java.lang.IllegalArgumentException: 
> Vertex with id already exists: 1{code}
> This comes from the fact that {{scriptEngines}} are loaded on session 
> creation. I'm guessing this is required? But running initializing scripts 
> could be dangerous.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to