0 Replies Latest reply on Feb 6, 2012 12:12 PM by Dario Salvi

    Long running processes generate random parallel executing processes (v 4.4)

    Dario Salvi Newbie

      Hi all,

       

      I am observing a strange behaviour of JBPM.

      I am using the old version 4.4 still.

      I am using HSQLDB as DB, but I don't need persistence at all (haven't found a way to disable it) so I use it as memory tables.

       

      My situation is the following: I have a process, defined in JPDL, that generates two parallel sub-processes.

       

      Both sub-processes call a java node and both get stuck on a Object.wait() function.

      If the application is not used, these two functions can wait for hours.

       

       

      Now what we have observed is the following:

       

      I start the application

      the application starts our process

      I leave the application idle for some hours (around 6)

       

      Then I have a look at the logs and I see clearly:

       

      JBPM, after 30 minutes, decides to generate a new and parallel thread of one of the two stuck sub-processes

      after other 30 minutes -sometimes- it generates a third parallel thread and then stops

       

       

      The result is a complete mess: I have three parallel executing workflows that are waiting for the same sempahore to be notified. As soon as the user starts interacting with the application strange things can happen (as you can immagine).

       

      Here is a trace of a log that should tell us what is happening. This was taken exactly at the time the "ghost" thread is started:

       

      2012-02-06 17:38:02,790 DEBUG [DispatcherThread] org.jbpm.pvm.internal.jobexecutor.DispatcherThread - submitting jobs [455]

      2012-02-06 17:38:02,790 DEBUG [DispatcherThread] org.jbpm.pvm.internal.jobexecutor.DispatcherThread - added jobs [455] to the queue

      2012-02-06 17:38:02,790 DEBUG [pool-11-thread-3] org.jbpm.pvm.internal.tx.HibernateSessionResource - ----- beginning hibernate tx 26380393 --------------------------------------------------------

      2012-02-06 17:38:03,055 DEBUG [DispatcherThread] org.jbpm.pvm.internal.tx.HibernateSessionResource - ----- beginning hibernate tx 20073097 --------------------------------------------------------

      2012-02-06 17:38:03,133 DEBUG [pool-11-thread-3] org.jbpm.pvm.internal.cmd.ExecuteJobCmd - executing job ExecuteActivityMessage[455]...

      2012-02-06 17:38:03,133 DEBUG [DispatcherThread] org.jbpm.pvm.internal.tx.HibernateSessionResource - ----- committing hibernate tx 20406588 -------------------------------------------------------

      2012-02-06 17:38:03,133 DEBUG [DispatcherThread] org.jbpm.pvm.internal.jobexecutor.DispatcherThread - submitting jobs [456]

      2012-02-06 17:38:03,133 DEBUG [DispatcherThread] org.jbpm.pvm.internal.jobexecutor.DispatcherThread - added jobs [456] to the queue

      2012-02-06 17:38:03,133 DEBUG [pool-11-thread-4] org.jbpm.pvm.internal.tx.HibernateSessionResource - ----- beginning hibernate tx 10215518 --------------------------------------------------------

      2012-02-06 17:38:03,133 DEBUG [DispatcherThread] org.jbpm.pvm.internal.tx.HibernateSessionResource - ----- beginning hibernate tx 12955609 --------------------------------------------------------

      2012-02-06 17:38:03,196 DEBUG [DispatcherThread] org.jbpm.pvm.internal.tx.HibernateSessionResource - ----- committing hibernate tx 33482717-------------------------------------------------------

      2012-02-06 17:38:03,196 DEBUG [DispatcherThread] org.jbpm.pvm.internal.tx.HibernateSessionResource - ----- beginning hibernate tx 2339094 --------------------------------------------------------

      2012-02-06 17:38:03,196 DEBUG [pool-11-thread-4] org.jbpm.pvm.internal.cmd.ExecuteJobCmd - executing job ExecuteActivityMessage[456]...

      2012-02-06 17:38:03,196 DEBUG [DispatcherThread] org.jbpm.pvm.internal.tx.HibernateSessionResource - ----- committing hibernate tx 24080755 -------------------------------------------------------

      2012-02-06 17:38:03,352 DEBUG [pool-11-thread-4] org.jbpm.pvm.internal.model.op.ExecuteActivity - execution[MainWorkflow.home.to Subprocess1.453] executes activity(HomeSubprocess)

      2012-02-06 17:38:03,352 DEBUG [pool-11-thread-3] org.jbpm.pvm.internal.model.op.ExecuteActivity - execution[MainWorkflow.home.to Subprocess2.454] executes activity(LeftMenuSubprocess)

      2012-02-06 17:38:03,851 DEBUG [pool-11-thread-3] org.jbpm.pvm.internal.model.ProcessDefinitionImpl - creating new execution for process 'LeftMenuProcess'

      2012-02-06 17:38:03,851 DEBUG [pool-11-thread-4] org.jbpm.pvm.internal.model.ProcessDefinitionImpl - creating new execution for process 'HomeSubprocess'

      2012-02-06 17:38:03,866 DEBUG [pool-11-thread-3] org.jbpm.pvm.internal.id.DatabaseIdComposer - generated execution id LeftMenuProcess.463

      2012-02-06 17:38:03,882 DEBUG [pool-11-thread-4] org.jbpm.pvm.internal.id.DatabaseIdComposer - generated execution id HomeSubprocess.464

      2012-02-06 17:38:03,976 DEBUG [pool-11-thread-4] org.jbpm.pvm.internal.model.op.ExecuteActivity - executing activity(start1)

      2012-02-06 17:38:03,976 DEBUG [pool-11-thread-3] org.jbpm.pvm.internal.model.op.ExecuteActivity - executing activity(start1)

       

      It seems that the DispatcherThread creates new jobs, which create two new threads: pool-11-thread-3 and pool-11-thread-4

       

       

      Do you have an idea of how to fix this?

       

      Thank you in advance for any help!

      I am completely lost!

       

      Dario

       

      Added a log that shows what happens..