Details
-
Bug
-
Status: Closed
-
Critical
-
Resolution: Fixed
-
Scripting JavaScript 2.0.10
-
None
Description
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.