Openbravo Issue Tracking System - Modules
View Issue Details
0028915Moduleszz obsolete Activiti Integrationpublic2015-02-11 13:472015-03-02 14:54
egoitz 
alostale 
urgentmajoralways
closedfixed 
5
 
 
AugustoMauch
0028915: Not possible to start tomcat after use the dunning module
Having certain data on the activity tables tomcat does not start.
Contact eca for a database where the problem is reproducible.

REmoving all the data from
act_ tables
and restoring the original data on act_ge_property
tomcat starts
No tags attached.
related to design defect 0029089 new alostale Activiti integration uses its own db pool, it should use Openbravo's one 
Issue History
2015-02-11 13:47egoitzNew Issue
2015-02-11 13:47egoitzAssigned To => mtaal
2015-02-12 13:19jonalegriaesarteAssigned Tomtaal => alostale
2015-02-16 11:13jonalegriaesarteResolution time => 1425078000
2015-02-17 09:30jonalegriaesarteSummaryNot possible to start tomcat after use the duning module => Not possible to start tomcat after use the dunning module
2015-02-27 09:29alostaleRelationship addedblocks 0029089
2015-02-27 09:30alostaleRelationship replacedrelated to 0029089
2015-02-27 09:38alostaleNote Added: 0075015
2015-02-27 09:39alostaleNote Edited: 0075015bug_revision_view_page.php?bugnote_id=0075015#r7806
2015-02-27 09:46alostaleReview Assigned To => AugustoMauch
2015-02-27 10:05hgbotCheckin
2015-02-27 10:05hgbotNote Added: 0075019
2015-02-27 10:05hgbotStatusnew => resolved
2015-02-27 10:05hgbotResolutionopen => fixed
2015-02-27 10:05hgbotFixed in SCM revision => http://code.openbravo.com/erp/mods/org.openbravo.activiti/rev/9ce8cc16cb256dbc480cd116b949a6c454c07ae3 [^]
2015-02-27 10:12alostaleNote Added: 0075020
2015-03-02 14:54AugustoMauchNote Added: 0075090
2015-03-02 14:54AugustoMauchStatusresolved => closed
2022-02-18 04:21priyamCategoryActiviti Integration => Z_Obsolete Activiti Integration
2022-02-18 04:24priyamCategoryZ_Obsolete Activiti Integration => zz obsolete Activiti Integration

Notes
(0075015)
alostale   
2015-02-27 09:38   
(edited on: 2015-02-27 09:39)
This problem occurs when the number of jobs to execute [1] is big enough.

As reported in issue 0029089 activiti integration uses its own pool, among other stuff, when tomcat is started activiti loads the jobs to execute, when this number is big enough, this pool gets exhausted with connections that are in use and not yet closed trying to acquire a new connection. Because of default configuration of this pool, the maximum number of active connections is 8, and the behavior when the pool is exhausted is to wait indefinitely till one of the connections in use is released. This causes the process to be in a deadlock situation.

When this occurs, tomcat start up never ends (or tomcat start timeout is reached). It is possible to see there are 8 (the maximum default) idle in transaction connections which executed this query [2].

---
[1]
  select count(*)
    from ACT_RU_JOB
    where (RETRIES_ > 0)
      and (DUEDATE_ is null or DUEDATE_ < now())
      and (LOCK_OWNER_ is null or LOCK_EXP_TIME_ < now())
      and (RETRIES_ > 0)

[2] select *
    from ACT_RU_JOB J
     WHERE J.EXECUTION_ID_ = $1

(0075019)
hgbot   
2015-02-27 10:05   
Repository: erp/mods/org.openbravo.activiti
Changeset: 9ce8cc16cb256dbc480cd116b949a6c454c07ae3
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Fri Feb 27 09:45:58 2015 +0100
URL: http://code.openbravo.com/erp/mods/org.openbravo.activiti/rev/9ce8cc16cb256dbc480cd116b949a6c454c07ae3 [^]

fixed bug 28915: tomcat does not start when number of jobs to execute is big

  The problem is due the extra pool activiti uses, which was configured to acquire
  at most 8 connections and to wait for one of them is released when an extra one
  is required.

  When in this situation, more than 8 connections are used in parallel causing a
  deadlock situation.

  Temporary solution, till issue 29089 is fixed, consists in allowing activiti module
  to grow as much as needed, restoring to a maximum of 5 idle connections once the
  rest are released.

---
M config/applicationContext.xml
---
(0075020)
alostale   
2015-02-27 10:12   
new version 5.8.8 of activiti published including this patch
(0075090)
AugustoMauch   
2015-03-02 14:54   
Code review done by me, and tested by ECA