cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple exceptions when stressing a workflow

rufini
Champ in-the-making
Champ in-the-making
Hi. I'm having random errors when stressing my app.

I made a workflow with a UserTask that times out after 200 sec.

With a JMeter, I set up:

1) Request via GET the execution id "askForExecutionID"
2) Post that execution id with some extra data to process "processData"

In JMeter\Thread Group, I set: 100 threads & ramp-up period: 10 seconds

I start the tomcat, and run the JMeter, and, after a time, I got the 100 "askForExecutionID" OK and [usually] the 100 "processData" also OK.

But, when I run it a few times [waiting to all threads ends], I start to get random errors [about 13-25%] in the "processData"s.

The exceptions may vary and are:


org.activiti.engine.ActivitiOptimisticLockingException: TimerEntity[39844] was updated by another transaction concurrently


org.activiti.engine.ActivitiOptimisticLockingException: ExecutionEntity[6246] was updated by another transaction concurrently


org.activiti.engine.ActivitiException: Cannot find task with id 6432


org.apache.ibatis.exceptions.PersistenceException:
### Error updating database.  Cause: com.mysql.jdbc.exceptions.MySQLTransactionRollbackException: Deadlock found when trying to get lock; try restarting transaction
### The error may involve org.activiti.engine.impl.persistence.entity.HistoricTaskInstanceEntity.updateHistoricTaskInstance-Inline
### The error occurred while setting parameters
### Cause: com.mysql.jdbc.exceptions.MySQLTransactionRollbackException: Deadlock found when trying to get lock; try restarting transaction

My config:

org.springframework.jdbc.datasource.SimpleDriverDataSource (com.mysql.jdbc.Driver)
org.springframework.jdbc.datasource.DataSourceTransactionManager


   <bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
      <property name="dataSource" ref="dataSource" />
      <property name="transactionManager" ref="transactionManager" />
      <property name="databaseSchemaUpdate" value="true" />
      <property name="jobExecutorActivate" value="true" />
      <property name="deploymentResources" value="some.bpmn20.xml" />
      <property name="beans">
         <map>
            <entry key="timeoutTask" value-ref="timeoutTask"/>
         </map>
      </property>
   </bean>


Please, letme know wich config data can I post to make this question cleaner.

Thanks in advance!
rufini
12 REPLIES 12

crico
Champ in-the-making
Champ in-the-making
Deleting from the history through the HistoricXXManager (engine IMPL, not API) while the process is ending is generally not a good idea.

1. Can't you delete the history externally (from the method that is calling the API)
2. If you don't want history, why don't you just turn the history-level to none?

2. I don't want to save the history for a particular case of a process (when a execution of this process does not meet a particular conditions, because this case generates millions of records in database), but I save it for others.

Is there any option to discard processes that do not persist in the history?

Regards.

frederikherema1
Star Contributor
Star Contributor
There is no per-process history setting.

So the only option there is to accomplish this is to roll your own solution that does periodic historicProcessInstance queries for finished workflows of that certain type (or having certain conditions be met) and delete those through the API…

Perhaps write an activiti-process for this using a timer-start event Smiley Wink

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
Perhaps Activiti could implement support of this element:
<xsd:element name="auditing" type="tAuditing"/>
<xsd:complexType name="tAuditing">
  <xsd:complexContent>
   <xsd:extension base="tBaseElement"/>
  </xsd:complexContent>
</xsd:complexType>

And use this to support per process auditing/history? Would not be to difficult I think.