Suspending a process with active timer can cause AcquireJobsRunnable to get into a loop that causes heavy load on database

Description

Hi,

If you suspend a process with a timer there can be an entry in the ACT_RU_JOB table that will not be actioned.

However,the AcquireJobsRunnable class will still include these timers in the querry run by GetUnlockedTimersByDuedateCmd. Eventually the timer's due date will be in the past. This past timer date results in a negative value for millisToWait.

When millisToWait is negative the AcquireJobsRunnable doesn't sleep. Since the process is suspended the timer is never actioned. The end result is the AcquireJobsRunnable gets into a loop where it is continuously hitting the database with a query.

In my situation, this had a fairly detrimental affect on performance.

BTW, the workaround that I went with is to delete the jobs (for the time being the system doesn't actually need to resume a suspended job). I couldn't find a way of doing this in the official Java Doc so went with the following quick and dirty approach:

Thanks,

Setanta

Environment

None

Assignee

Frederik Heremans

Reporter

Setanta Mathews

Labels

None

Fix versions

Affects versions

Priority

Major
Configure