Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-1972

JavaScript ScriptEngine is not thread safe

    XMLWordPrintableJSON

Details

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

      Attachments

        Activity

          People

            fmeschbe Felix Meschberger
            fmeschbe Felix Meschberger
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: