[
https://jira.jboss.org/jira/browse/JBPM-2797?page=com.atlassian.jira.plug...
]
Bernd Ruecker commented on JBPM-2797:
-------------------------------------
Let's wait for Alex to comment on this. In trunk I committed it an hour ago. In the
SOA-P 4.3.0 used at the customer here it is definitely not included.
Bug in LockMonitor unlocks EVERY Job, not only overdue ones
-----------------------------------------------------------
Key: JBPM-2797
URL:
https://jira.jboss.org/jira/browse/JBPM-2797
Project: jBPM
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: Runtime Engine
Affects Versions: jBPM 3.2.8
Reporter: Bernd Ruecker
Assignee: Bernd Ruecker
The LockMonitorThread has a really huge bug.
It queries all jobs with overdue lock time:
Date threshold = new Date(System.currentTimeMillis() - maxLockTime - lockBufferTime);
List overdueJobs =
jbpmContext.getJobSession().findJobsWithOverdueLockTime(threshold);
by this query:
<query name="JobSession.findJobsWithOverdueLockTime">
select job
from org.jbpm.job.Job as job
where job.lockTime > :threshold
</query>
This finds all jobs with a lock timer NEWER than the treshold, not OLDER as it should be.
So the query must be:
<query name="JobSession.findJobsWithOverdueLockTime">
select job
from org.jbpm.job.Job as job
where job.lockTime < :threshold
</query>
So if a job runs exactly at the time the LockMonitorThread comes active, this leads to a
StaleObjectException in the JobExecution. Since the LockMonitorThread runs only every
minute, this is a pretty rare case. The more puzzling it was to find ;-) Surprising, that
it wasn't recognized that long!
I commit the changed query to HEAD.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira