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

PerCaseRuntimeManager getting stuck because bad cleanup

XMLWordPrintable

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

      Debug logs confirmed finally the right path.

      Process is completed by another thread (Thread-408)

      19:26:19,303 f86v DEBUG [org.jbpm.runtime.manager.impl.mapper.JPAMapper] (Thread-408) Removing from persistence mapping with context id 1173729 KieSessionId 1205836 and owner id 
      19:26:19,304 f86v DEBUG [org.jbpm.runtime.manager.impl.PerCaseRuntimeManager] (Thread-408) afterProcessCompleted KieSession 1205836 found for contextId 1173729 
      
      19:26:20,638 f86v DEBUG [org.jbpm.runtime.manager.impl.PerCaseRuntimeManager] (Thread-407) Calling createLockOnGetEngine kSessionId null with pid 1173716 and caseId null
      19:26:20,638 f86v DEBUG [org.jbpm.runtime.manager.impl.AbstractRuntimeManager] (Thread-407) About to lock null for runtime org.jbpm.runtime.manager.impl.RuntimeEngineImpl@49354268 (KieSessionId=null, lockedKieSessionId=null context=1173716)
      19:26:20,638 f86v DEBUG [org.jbpm.runtime.manager.impl.AbstractRuntimeManager] (Thread-407) Invalid lock null for runtime org.jbpm.runtime.manager.impl.RuntimeEngineImpl@49354268 (KieSessionId=null, lockedKieSessionId=null context=1173716)
      19:26:20,638 f86v DEBUG [org.jbpm.runtime.manager.impl.PerCaseRuntimeManager] (Thread-407) Saved Local runtimes caseId=null, pid=1173716 for runtime org.jbpm.runtime.manager.impl.RuntimeEngineImpl@49354268 (KieSessionId=null, lockedKieSessionId=null context=1173716) with local map {1173716=org.jbpm.runtime.manager.impl.RuntimeEngineImpl@49354268 (KieSessionId=null, lockedKieSessionId=null context=1173716)}
      19:26:20,638 f86v DEBUG [org.jbpm.runtime.manager.impl.PerCaseRuntimeManager] (Thread-407) initKieSession for contextId 1173716
      19:26:20,638 f86v DEBUG [org.jbpm.runtime.manager.impl.mapper.JPAMapper] (Thread-407) Find mapping with context id 1173716 and owner id 
      19:26:20,638 f86v DEBUG [org.jbpm.runtime.manager.impl.mapper.JPAMapper] (Thread-407) Not Found mapping with context id 1173716 and owner id 
      19:26:20,642 f86v DEBUG [org.jbpm.process.core.timer.impl.GlobalTimerService] (Thread-407) Returning  timers [] for KieSessionId 207
      19:26:20,647 f86v DEBUG [org.jbpm.runtime.manager.impl.PerCaseRuntimeManager] (Thread-407) KieSession created with kieSessionId 1205849 for contextId 1173716
      

      this is the creation not releasing it when

      19:26:19,634 f86v DEBUG [org.jbpm.runtime.manager.impl.PerCaseRuntimeManager] (Thread-407) Releasing lock for kSessionId 1205847 with contextId 1173716
      19:26:19,634 f86v DEBUG [org.jbpm.runtime.manager.impl.AbstractRuntimeManager] (Thread-407) Attempt null to unlock 1205847 for runtime org.jbpm.runtime.manager.impl.RuntimeEngineImpl@57da6fdb (KieSessionId=1205847, lockedKieSessionId=1205836 context=1173716)
      

      not releasing because it was locked for 1205836 and not for 1205847 causing the job executor to stall

      Active mq jobs thread locked and never moved forward (executor for async nodes)

      19:26:19,629 f86v DEBUG [org.jbpm.runtime.manager.impl.PerCaseRuntimeManager] (Thread-10 (ActiveMQ-client-global-threads)) Calling createLockOnGetEngine kSessionId 1205836 with pid 1173711 and caseId null
      19:26:19,630 f86v DEBUG [org.jbpm.runtime.manager.impl.AbstractRuntimeManager] (Thread-10 (ActiveMQ-client-global-threads)) About to lock 1205836 for runtime org.jbpm.runtime.manager.impl.RuntimeEngineImpl@400ece23 (KieSessionId=null, lockedKieSessionId=1205836 context=1173711)
      19:26:19,630 f86v DEBUG [org.jbpm.runtime.manager.impl.AbstractRuntimeManager] (Thread-10 (ActiveMQ-client-global-threads)) Found lock created 1205836 for runtime org.jbpm.runtime.manager.impl.RuntimeEngineImpl@400ece23 (KieSessionId=null, lockedKieSessionId=1205836 context=1173711)
      19:26:19,630 f86v DEBUG [org.jbpm.runtime.manager.impl.AbstractRuntimeManager] (Thread-10 (ActiveMQ-client-global-threads)) Trying to get java.util.concurrent.locks.ReentrantLock@26f3f611[Locked by thread Thread-407] a lock 1205836 for runtime org.jbpm.runtime.manager.impl.RuntimeEngineImpl@400ece23 (KieSessionId=null, lockedKieSessionId=1205836 context=1173711)
      

      after testing. It the process is dead but the case is still open this happens (kie sessions are dead.
      ContextMappingInfo

      {ksessionId=2, ownerId=org.jbpm.cases:case-module:1.0.0, contextId=HR-0000000001}

      SESSION -> 2
      SESSION -> 3
      SESSION -> 4
      SESSION -> 5
      SESSION -> 6

      The only possitiblity is going though the audit tables (log required to get the proper kie session)

              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:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: