You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Jobs are sometimes no longer executed by configured schedule.
Workaround
After server restart, jobs are running again as expected.
Cause
The suspected problem is in SchedulePing.checkActiveSchedule(). When startAllJobs() takes longer than interval, a new iteration of checkActiveSchedule() will run and concurrently run startAllJobs(), since startedJobs is not yet set to true. This causes stop() to be run on the JobScheduler which sets the jobExecutor to stopped. This will prevent the jobExecutor to decrease its running counter at the end of its execute function.
To solve, either the stopped flag in the jobExecutor needs to be cleared during the start of the JobScheduler, or it needs to be made sure that the start function is only run once. Either way it would make sense to only allow one execution of checkActiveSchedule to run in parallel.
Reproduce
See #603 for a test case demonstrating this race-condition.
The text was updated successfully, but these errors were encountered:
Problem
Jobs are sometimes no longer executed by configured schedule.
Workaround
After server restart, jobs are running again as expected.
Cause
The suspected problem is in
SchedulePing.checkActiveSchedule()
. WhenstartAllJobs()
takes longer thaninterval
, a new iteration ofcheckActiveSchedule()
will run and concurrently runstartAllJobs()
, sincestartedJobs
is not yet set to true. This causesstop()
to be run on theJobScheduler
which sets thejobExecutor
to stopped. This will prevent thejobExecutor
to decrease its running counter at the end of its execute function.To solve, either the
stopped
flag in thejobExecutor
needs to be cleared during the start of theJobScheduler
, or it needs to be made sure that thestart
function is only run once. Either way it would make sense to only allow one execution ofcheckActiveSchedule
to run in parallel.Reproduce
See #603 for a test case demonstrating this race-condition.
The text was updated successfully, but these errors were encountered: