]
Alejandro Guizar resolved JBPM-2797.
------------------------------------
Labels: jbpm3 job lock monitor threshold (was: )
Assignee: Alejandro Guizar (was: Bernd Ruecker)
Resolution: Duplicate Issue
Bug in LockMonitor unlocks EVERY Job, not only overdue ones
-----------------------------------------------------------
Key: JBPM-2797
URL:
https://jira.jboss.org/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: Alejandro Guizar
Labels: jbpm3, job, lock, threshold, monitor
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.
-
For more information on JIRA, see: