I recently upgraded to 6.5.0 from 6.3.0 and these deadlock error started coming after this upgradation.
Database - postgres
And I have “Multi-Schema Multi-Tenancy” configured.
These deadlocks are coming for ACT_RU_EXECUTION, ACT_RE_PROCDEF table.
ACT_RU_EXECUTION -
I debug more for one of the failure and found that, one request to delete a process is sent, and it took around 10 mins to get a response from RuntimeService.deleteProcessInstance(String, String) API. Since response din’t came for long, so another request is sent for delete and hence deadlock.
I have 2 questions here -
- What could be the probable reason for such a simple operation taking so much time. The flowable engine is running on same server, so there is no network latency.
- Once deadlock error comes, any operation for any tenant also starts failing. For example even process launch is failing -
Error querying database. Cause: org.postgresql.util.PSQLException: ERROR: current transaction is aborted, commands ignored until end of transaction block
The error may exist in org/flowable/db/mapping/entity/ProcessDefinition.xml
The error may involve org.flowable.engine.impl.persistence.entity.ProcessDefinitionEntityImpl.selectProcessDefinition-Inline
The error occurred while setting parameters
SQL: select * from ACT_RE_PROCDEF where ID_ = ?
Cause: org.postgresql.util.PSQLException: ERROR: current transaction is aborted, commands ignored until end of transaction block
at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:149)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:140)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:76)
at org.flowable.common.engine.impl.db.DbSqlSession.selectById(DbSqlSession.java:304)
at org.flowable.common.engine.impl.db.AbstractDataManager.findById(AbstractDataManager.java:70)
at org.flowable.common.engine.impl.persistence.entity.AbstractEntityManager.findById(AbstractEntityManager.java:40)
at org.flowable.engine.impl.cmd.StartProcessInstanceCmd.getProcessDefinition(StartProcessInstanceCmd.java:202)
at org.flowable.engine.impl.cmd.StartProcessInstanceCmd.execute(StartProcessInstanceCmd.java:111)
at org.flowable.engine.impl.cmd.StartProcessInstanceCmd.execute(StartProcessInstanceCmd.java:52)
at org.flowable.engine.impl.interceptor.CommandInvoker$1.run(CommandInvoker.java:51)
at org.flowable.engine.impl.interceptor.CommandInvoker.executeOperation(CommandInvoker.java:93)
at org.flowable.engine.impl.interceptor.CommandInvoker.executeOperations(CommandInvoker.java:72)
at org.flowable.engine.impl.interceptor.CommandInvoker.execute(CommandInvoker.java:56)
at org.flowable.engine.impl.interceptor.BpmnOverrideContextInterceptor.execute(BpmnOverrideContextInterceptor.java:25)
at org.flowable.common.engine.impl.interceptor.TransactionContextInterceptor.execute(TransactionContextInterceptor.java:53)
at org.flowable.common.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:72)
at org.flowable.common.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:51)
at org.flowable.common.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:30)
at org.flowable.common.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:56)
at org.flowable.common.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:51)
at org.flowable.engine.impl.RuntimeServiceImpl.startProcessInstanceById(RuntimeServiceImpl.java:156)