JavaScript ScriptEngine is not thread safe
------------------------------------------

                 Key: SLING-1972
                 URL: https://issues.apache.org/jira/browse/SLING-1972
             Project: Sling
          Issue Type: Bug
          Components: Scripting
    Affects Versions: Scripting JavaScript 2.0.10
            Reporter: Felix Meschberger
            Assignee: Felix Meschberger
            Priority: Critical
             Fix For: Scripting JavaScript 2.0.12


The JavaScriptScriptEngine has a concurrency issue in that it keeps the 
top-level scope of the script executed as an instance field. Since the servlet 
resolver is caching SlingScript instances and the SlingScript has a reference 
to the ScriptEngine (JavaScriptScriptEngine in this case) executing the same 
script concurrently causes them all to use the same top-level scope and thus to 
share variables .....

The fix is to remove the "scope" field because this is not really: The top 
level scope is maintained the by Rhino Context object which is used to execute 
the script and which manages the top level scope in a thread safe way.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to