Uploaded image for project: 'OpenIDM'
  1. OpenIDM
  2. OPENIDM-1823

getScriptBindings function of ServiceScript (ScriptRegistryImpl.java) slows down extremely when accessed in parallel from multiple threads

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: OpenIDM 2.1.1
    • Fix Version/s: None
    • Component/s: Module - Scripting
    • Labels:

      Description

      If a taskscanner starts a lot of workflows at the same time trying to call the getScriptBindings method of ServiceScript (e.g. "numberOfThreads" : 5, 23 workflows) then it extremely slows down the script service. Therefore it takes too much time to initialize the scriptEngine variable of LibraryRecord class and it results in a NullPointerException at line 519. of ScriptRegistryImpl.java:
      final ScriptEngine engine = LibraryRecord.this.scriptEngine.get();
      where the scriptEngine is null.
      The first few calls of this method fail (NPE) but once that variable is properly initialized the subsequent calls succeed.
      By changing the number of threads of the taskscanner configuration to 1 makes the problem disappear.

        Attachments

        1. createUsers.sh
          9 kB
        2. schedule-taskscan.json
          0.8 kB
        3. startworkflow.js
          0.2 kB
        4. test.bpmn20.xml
          1 kB

          Activity

            People

            • Assignee:
              dhogan Dirk Hogan
              Reporter:
              omebold omebold
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: