Uploaded image for project: 'Red Hat Process Automation Manager'
  1. Red Hat Process Automation Manager
  2. RHPAM-3451

[ONE-OFF](7.9.1)Lazy loading runtime engine can cause not unlock the kie session id during disposal

    XMLWordPrintable

Details

    • Support Patch
    • Resolution: Done
    • Major
    • 7.9.1.GA
    • 7.7.1.GA, 7.9.1.GA
    • jBPM Core
    • False
    • False
    • Hide
      PATCH NAME: RHPAM-3451
      PRODUCT NAME: Red Hat Process Automation Manager
      VERSION: 7.9.1
      DESCRIPTION: One-off patch for RHPAM-3451:
      * Lazy loading runtime engine can cause not unlock the kie session id during disposal - https://issues.redhat.com/browse/RHPAM-3447

      This patch is on top of the one-off patch RHPAM-3435 which contains the fixes for:
      * Ensure disposeRuntimeEngine is called in RuntimeManager implementations in finally block
         https://issues.redhat.com/browse/RHPAM-3360
        
      * PerCaseRuntimeManager getting stuck because bad cleanup
         https://issues.redhat.com/browse/RHPAM-3425

      MANUAL INSTALL INSTRUCTIONS FOR ALL PLATFORMS:

      1. Install one-off patch RHPAM-3435. (If the one-patch RHPAM-3435 is already installled skip this step)

      2. Backup and remove the following jar:

            jbpm-runtime-manager-7.44.0.Final-redhat-00006-RHPAM-3435.jar
            
         from the following locations:

            $SERVER_DEPLOYMENT_DIR/business-central.war/WEB-INF/lib/
            $SERVER_DEPLOYMENT_DIR/kie-server.war/WEB-INF/lib/
            $RHPAM_ENGINE/
            $YOUR_OWN_APPLICATION_LIB/

      2. Unzip the file jboss-rhba-7.9.1-RHPAM-3451.zip and copy:

            RHPAM-3451/jbpm-runtime-manager-7.44.0.Final-redhat-00006-RHPAM-3451.jar
            
         to:

            $SERVER_DEPLOYMENT_DIR/business-central.war/WEB-INF/lib
            $SERVER_DEPLOYMENT_DIR/kie-server.war/WEB-INF/lib
            $RHPAM_ENGINE
            $YOUR_OWN_APPLICATION_LIB

      MANUAL INSTALL INSTRUCTIONS FOR MAVEN BASED PROJECTS:

          1. Extract the attached zip (jboss-rhba-7.9.1-RHPAM-3451.zip) and change into the RHPAM-3451 directory

          2. Run the following commands to install the patch binaries to the local maven repository:
          
               mvn install:install-file -Dfile=jbpm-runtime-manager-7.44.0.Final-redhat-00006-RHPAM-3451.jar -Dsources=jbpm-runtime-manager-7.44.0.Final-redhat-00006-RHPAM-3451-sources.jar -DpomFile=jbpm-runtime-manager-7.44.0.Final-redhat-00006-RHPAM-3451.pom -Dpackaging=jar
             

          3. Override the original version of modified jars explicitly declaring them in <dependencyManagement> of your project pom.xml:

                   <dependency>
                      <groupId>org.jbpm</groupId>
                      <artifactId>jbpm-runtime-manager</artifactId>
                      <version>7.44.0.Final-redhat-00006-RHPAM-3451</version>
                   </dependency>



      ADDITIONAL INSTALL INSTRUCTIONS FOR ALL PLATFORMS:

          Find and replace the file
              jbpm-runtime-manager-7.44.0.Final-redhat-00006-RHPAM-3435.jar
           

          with the patched jar:
             jbpm-runtime-manager-7.44.0.Final-redhat-00006-RHPAM-3451.jar
            

          for all occurences of that file in your project.


      CREATOR:
              Gary Hu
      DATE:
              4-Feb-2021
      Show
      PATCH NAME: RHPAM-3451 PRODUCT NAME: Red Hat Process Automation Manager VERSION: 7.9.1 DESCRIPTION: One-off patch for RHPAM-3451 : * Lazy loading runtime engine can cause not unlock the kie session id during disposal - https://issues.redhat.com/browse/RHPAM-3447 This patch is on top of the one-off patch RHPAM-3435 which contains the fixes for: * Ensure disposeRuntimeEngine is called in RuntimeManager implementations in finally block     https://issues.redhat.com/browse/RHPAM-3360    * PerCaseRuntimeManager getting stuck because bad cleanup     https://issues.redhat.com/browse/RHPAM-3425 MANUAL INSTALL INSTRUCTIONS FOR ALL PLATFORMS: 1. Install one-off patch RHPAM-3435. (If the one-patch RHPAM-3435 is already installled skip this step) 2. Backup and remove the following jar:       jbpm-runtime-manager-7.44.0.Final-redhat-00006-RHPAM-3435.jar           from the following locations:       $SERVER_DEPLOYMENT_DIR/business-central.war/WEB-INF/lib/       $SERVER_DEPLOYMENT_DIR/kie-server.war/WEB-INF/lib/       $RHPAM_ENGINE/       $YOUR_OWN_APPLICATION_LIB/ 2. Unzip the file jboss-rhba-7.9.1- RHPAM-3451 .zip and copy:        RHPAM-3451 /jbpm-runtime-manager-7.44.0.Final-redhat-00006- RHPAM-3451 .jar           to:       $SERVER_DEPLOYMENT_DIR/business-central.war/WEB-INF/lib       $SERVER_DEPLOYMENT_DIR/kie-server.war/WEB-INF/lib       $RHPAM_ENGINE       $YOUR_OWN_APPLICATION_LIB MANUAL INSTALL INSTRUCTIONS FOR MAVEN BASED PROJECTS:     1. Extract the attached zip (jboss-rhba-7.9.1- RHPAM-3451 .zip) and change into the RHPAM-3451 directory     2. Run the following commands to install the patch binaries to the local maven repository:               mvn install:install-file -Dfile=jbpm-runtime-manager-7.44.0.Final-redhat-00006- RHPAM-3451 .jar -Dsources=jbpm-runtime-manager-7.44.0.Final-redhat-00006- RHPAM-3451 -sources.jar -DpomFile=jbpm-runtime-manager-7.44.0.Final-redhat-00006- RHPAM-3451 .pom -Dpackaging=jar             3. Override the original version of modified jars explicitly declaring them in <dependencyManagement> of your project pom.xml:              <dependency>                 <groupId>org.jbpm</groupId>                 <artifactId>jbpm-runtime-manager</artifactId>                 <version>7.44.0.Final-redhat-00006- RHPAM-3451 </version>              </dependency> ADDITIONAL INSTALL INSTRUCTIONS FOR ALL PLATFORMS:     Find and replace the file         jbpm-runtime-manager-7.44.0.Final-redhat-00006-RHPAM-3435.jar           with the patched jar:        jbpm-runtime-manager-7.44.0.Final-redhat-00006- RHPAM-3451 .jar            for all occurences of that file in your project. CREATOR:         Gary Hu DATE:         4-Feb-2021
    • Undefined
    • ---
    • ---

    Description

      Workaround
      -Dorg.jbpm.rm.engine.eager=true

      When the pattern

             RuntimeManager manager = RuntimeManagerRegistry.get().getManager(deploymentUnit.getIdentifier());
              RuntimeEngine engine = manager.getRuntimeEngine(ProcessInstanceIdContext.get(pid));
              // no op so the runtime is not being init when lazy loading is used
              manager.disposeRuntimeEngine(engine);
      

      in this case with lazy init the dipose engine won't happen as kie session id is not being loaded yet.

      Before this was masked by the fact CanDispose was loading the kie session id before hand:
      https://github.com/kiegroup/jbpm/blob/7.44.0.Final/jbpm-runtime-manager/src/main/java/org/jbpm/runtime/manager/impl/AbstractRuntimeManager.java#L201

      so in here
      https://github.com/kiegroup/jbpm/blob/7.44.0.Final/jbpm-runtime-manager/src/main/java/org/jbpm/runtime/manager/impl/PerCaseRuntimeManager.java#L247
      https://github.com/kiegroup/jbpm/blob/7.44.0.Final/jbpm-runtime-manager/src/main/java/org/jbpm/runtime/manager/impl/PerCaseRuntimeManager.java#L250
      had always value

      because of this other bug:
      https://github.com/kiegroup/jbpm/blob/7.44.0.Final/jbpm-runtime-manager/src/main/java/org/jbpm/runtime/manager/impl/PerCaseRuntimeManager.java#L269

      not release with right kie session id, I had to move the kie session id before the try-catch block... causing this scenario not to work.

      Attachments

        Issue Links

          Activity

            People

              jbn-patch-team JBN Patch Team list
              rhn-support-ghu Gary Hu
              Gonzalo Muñoz Fernández Gonzalo Muñoz Fernández
              Gonzalo Muñoz Fernández Gonzalo Muñoz Fernández
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: