but some jobs not picked by job executor
for example :
jobs2 and jobs3 never picked by job executor. all other jobs work fine but jobs2 and jobs3 never picked by executor.
logging:
level:
'[org.camunda.bpm.engine.jobexecutor]': DEBUG
'[org.camunda.bpm.engine.impl.persistence.entity.JobEntity]': DEBUG
'[org.camunda.bpm.engine.cmd]': INFO
and found this output on my console:
2021-01-14 10:59:47.113 DEBUG 5048 --- [ingJobExecutor]] org.camunda.bpm.engine.jobexecutor : ENGINE-14012 Job acquisition thread woke up
2021-01-14 10:59:47.114 DEBUG 5048 --- [ingJobExecutor]] o.c.b.e.i.p.e.J.selectNextJobsToExecute : ==> Preparing: select RES.ID_, RES.REV_, RES.DUEDATE_, RES.PROCESS_INSTANCE_ID_, RES.EXCLUSIVE_ from ACT_RU_JOB RES where (RES.RETRIES_ > 0) and ( RES.DUEDATE_ is null or RES.DUEDATE_ <= ? ) and (RES.LOCK_OWNER_ is null or RES.LOCK_EXP_TIME_ < ?) and RES.SUSPENSION_STATE_ = 1 and ( ( RES.EXCLUSIVE_ = 1 and not exists( select J2.ID_ from ACT_RU_JOB J2 where J2.PROCESS_INSTANCE_ID_ = RES.PROCESS_INSTANCE_ID_ -- from the same proc. inst. and (J2.EXCLUSIVE_ = 1) -- also exclusive and (J2.LOCK_OWNER_ is not null and J2.LOCK_EXP_TIME_ >= ?) -- in progress ) ) or RES.EXCLUSIVE_ = 0 ) LIMIT ? OFFSET ?
2021-01-14 10:59:47.115 DEBUG 5048 --- [ingJobExecutor]] o.c.b.e.i.p.e.J.selectNextJobsToExecute : ==> Parameters: 2021-01-14 10:59:47.113(Timestamp), 2021-01-14 10:59:47.113(Timestamp), 2021-01-14 10:59:47.113(Timestamp), 3(Integer), 0(Integer)
2021-01-14 10:59:47.116 DEBUG 5048 --- [ingJobExecutor]] o.c.b.e.i.p.e.J.selectNextJobsToExecute : <== Total: 0
2021-01-14 10:59:47.116 DEBUG 5048 --- [ingJobExecutor]] org.camunda.bpm.engine.jobexecutor : ENGINE-14022 Acquired 0 jobs for process engine 'default': []
After reformating my acquition statement looks like this:
select
RES.ID_,
RES.REV_,
RES.DUEDATE_,
RES.PROCESS_INSTANCE_ID_,
RES.EXCLUSIVE_
from ACT_RU_JOB RES where
(RES.RETRIES_ > 0)
and ( RES.DUEDATE_ is null or RES.DUEDATE_ <= ? )
and (RES.LOCK_OWNER_ is null or RES.LOCK_EXP_TIME_ < ?)
and RES.SUSPENSION_STATE_ = 1
and
( ( RES.EXCLUSIVE_ = 1 and not exists(
select
J2.ID_ from ACT_RU_JOB J2
where
J2.PROCESS_INSTANCE_ID_ = RES.PROCESS_INSTANCE_ID_ -- from the same proc. inst.
and (J2.EXCLUSIVE_ = 1) -- also exclusive
and (J2.LOCK_OWNER_ is not null
and J2.LOCK_EXP_TIME_ >= ?) -- in progress
) ) or RES.EXCLUSIVE_ = 0 ) LIMIT ? OFFSET ?
Having a look into the SQL statement and comparing the conditions your your job entries I could not find a reason while they are not picked up.
How does the acquistion statement look like in your application?
job executor not stuck in this case because of all other jobs picked fine.
after restart service working fine for all jobs.
but some times happening for some jobs. any have some particular reason?