IBM Support

JR51504: JAVASCRIPT LOOP DETECTION DOES NOT CATCH LOOPS THAT SPEND MOST OF THE TIME IN JAVA CODE

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • With APAR JR48395, a capability was introduced that helps you
    detect loops in JavaScript. However, JR48395 does not detect
    loops when a JavaScript issues Java calls in a loop and most of
    the execution time is spent inside the Java code. In the case
    for BPM, this where a managed asset (a JAR) has a loop in that
    code path which prevents it from returning back to the BPM
    engine for processing.
    
    .
    [10/22/14 16:05:42:466 EDT] 0000008e ThreadMonitor W
    WSVR0605W: Thread
     "WorkManager.bpm-em-workmanager : 14148" (00008338) has been
    active for
     668295 milliseconds and may be hung.  There is/are 1 thread(s)
    in total
     in the server that may be hung.
     at java.util.HashMap.findNonNullKeyEntry(HashMap.java:601)
     at java.util.HashMap.getEntry(HashMap.java:585)
     at java.util.HashMap.get(HashMap.java:571)
     at
    org.mozilla.javascript.JavaMembers.lookupClass(JavaMembers.java:
    833)
     at
    org.mozilla.javascript.NativeJavaClass.initMembers(NativeJavaCla
    ss.java:84)
     at
    org.mozilla.javascript.NativeJavaClass.<init>(NativeJavaClass.ja
    va:78)
     at
    org.mozilla.javascript.NativeJavaPackage.getPkgProperty(NativeJa
    vaPackage.java:164)
     at
    org.mozilla.javascript.NativeJavaPackage.get(NativeJavaPackage.j
    ava:114)
     at
    org.mozilla.javascript.ScriptableObject.getProperty(ScriptableOb
    ject.java:1617)
     at
    org.mozilla.javascript.ScriptRuntime.getObjectProp(ScriptRuntime
    .java:1437)
     at
    org.mozilla.javascript.ScriptRuntime.getObjectProp(ScriptRuntime
    .java:1423)
     at
    org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.jav
    a:3027)
     at
    org.mozilla.javascript.Interpreter.interpret(Interpreter.java:24
    87)
    

Local fix

Problem summary

  • The JavaScript loop detection implementation instructs the
    JavaScript engine to invoke a callback that IBM BPM provides
    every 25 million JavaScript instructions. This callback checks
    whether the configured timeout was exceeded since the start of
    the JavaScript. If the timeout was exceeded, IBM BPM either
    throws a LoopDetectionException or logs an error message,
    depending on the configuration. If the script repeatedly calls
    Java methods that use most of the execution time, 25 million
    JavaScript instructions might take much longer than the
    configured timeout and the loop detection does not interrupt
    such long running scripts quickly.
    

Problem conclusion

  • A fix is/will be available that allows you to configure  the
    number of JavaScript instructions between the calls to the
    callback for loop detection in the 100Custom.xml file:
    
      <common merge="mergeChildren">
     <javascript-engine>
      <instruction-threshold>250</instruction-threshold>
     </javascript-engine>
      </common>
    
    IBM BPM multiplies the configured value by 1000 before
    instructing the JavaScript engine to call the loop-detection
    callback. The default value is 250. This means that the
    JavaScript engine calls the IBM BPM loop detection callback
    every 250000 JavaScript instructions.
    
    On Fix Central (http://www.ibm.com/support/fixcentral), search
    for JR51504:
    
    1. Select IBM Business Process Manager with your edition from
      the product selector, the installed version to the fix pack
      level, and your platform, and then click Continue.
    
    2. Select APAR or SPR, enter JR51504, and click Continue.
    
    When you download fix packages, ensure that you also download
    the readme file for each fix. Review each readme file for
    additional installation instructions and information about the
    fix.
    

Temporary fix

  • Not applicable
    

Comments

APAR Information

  • APAR number

    JR51504

  • Reported component name

    BPM ADVANCED

  • Reported component ID

    5725C9400

  • Reported release

    801

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2014-10-14

  • Closed date

    2014-12-10

  • Last modified date

    2016-08-17

  • APAR is sysrouted FROM one or more of the following:

  • APAR is sysrouted TO one or more of the following:

Fix information

  • Fixed component name

    BPM STANDARD

  • Fixed component ID

    5725C9500

Applicable component levels

  • R801 PSY

       UP

[{"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Product":{"code":"SSFTDH","label":"IBM Business Process Manager Standard"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"8.0.1","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
16 October 2021