Limit reschedule of expired jobs

Hello,

I would like to ask is it possible somehow to set limit to resets of one expired flowable job? I am asking this because I have issues sometimes when service task from bpmn diagram runs longer than already defined lock time of async job excetuor(30 minutes). When locktime expires, reset expired jobs thread detect this expired job and reschedule it again and another job acquisition thread acquire this job and try to re-execute it again which I would like to avoid. Another issue which I notice is slow running service task hold db locks in database(PostgreSQL) and rescheduled job is blocked and can’t continue with the execution due to blocked SQL query update ACT_RU_EXECUTION set LOCK_TIME_ = $1 where ID_ = $2 and (LOCK_TIME_ is null OR LOCK_TIME_ < $3) , this issue after several expired jobs leads to increase in db locks. I have plan to refactor this service task but I would like to ask you is there any generic solutions of this problem.

Thanks,
Kristian

Note that it is not a good practice to keep a thread/connection/transaction open for such a long time.

The reset job is doing it’s work correctly, as it believes the job has been stuck. If you want to change the time, there are properties for that:

Thank you for your response. I have already know about the following two configurations. As you said it’s not good practise to keep running longer tasks, so extending lock time of a job is not good option, neither reset interval. My question is it possible somehow to set max retries of expired jobs and after exceeding this rate to fail the whole process and stop rescheduling of this job?

No, that’s not possible. It’s possible to set retries on a job for regular executing, but these retries don’t influence the expired behavior.