Dead-lock on JBPM_JOB table with MySQL 5.0
Issue
With our jBPM 3.2 application, we are running into deadlock situations in production, which is reproducible with the following simple test process:
<process-definition xmlns="urn:jbpm.org:jpdl-3.2" name="Process_Timer2">
<start-state name="start-state1">
<transition to="node1"></transition>
</start-state>
<state name="Sleep">
<timer duedate="1 seconds" name="sleep_timer_2" transition="OK" repeat="NO">
<action></action>
</timer>
<transition to="node1" name="OK"></transition>
</state>
<node name="node1">
<action class="Wait"></action>
<transition to="Sleep"></transition>
</node>
</process-definition>
The Wait class does nothing more than sleep for a second before continuing the execution:
public void execute(ExecutionContext executionContext) throws Exception {
Thread.sleep(1000);
executionContext.leaveNode();
}
If we run two or more instances of this process definition, after a random time, we can experience this issue. This only happens if jBPM is configured with more than one JobExecutorThread's.
This is the MySQL support response on this incident:
Looks as though 2 holds an X lock on the record while 1 holds the insert intention lock. 2 can't then get the insert intention lock it needs to proceed. 1 can't continue past insert intention because 2 holds the X with a previous change. Deadlock, since neither can proceed.
Environment
- jBPM 3.2.9
- MySQL 5.0.94
- JobExecutor nbrOfThreads > 1
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
