[
https://issues.apache.org/jira/browse/SLING-1972?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12992413#comment-12992413
]
Felix Meschberger commented on SLING-1972:
------------------------------------------
Apparently the scope field has been added for SLING-1111 to preserve the scope
in consecutive eval calls. It hink in retrospect the SLING-1111 fix is actually
wrong and we should implement this behaviour differently.
Considering this a regression of my Rev. 1068807 fix and checking.
> 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