Uploaded image for project: 'jBPM'
  1. jBPM
  2. JBPM-9590

Lazy loading runtime engine can cause not unlock the kie session id during disposal

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 7.50.0.Final
    • None
    • None
    • None
    • False
    • False
    • NEW
    • NEW
    • Undefined
    • ---
    • ---

      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.

              elguardian@gmail.com Enrique González Martínez (Inactive)
              elguardian@gmail.com Enrique González Martínez (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: