Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Job scheduled form another cron job does not always start #362

Open
juvies opened this issue Nov 4, 2024 · 2 comments
Open

Job scheduled form another cron job does not always start #362

juvies opened this issue Nov 4, 2024 · 2 comments

Comments

@juvies
Copy link

juvies commented Nov 4, 2024

Cron job starts as planned, does some work and at the end schedules new cron jobs to start after 2 minutes.
Sometimes these additional jobs start executing and sometimes scheduled time goes by and jobs do not start.
I tried to set start time with 15, 20 minutes delay, but they still do not always start.

When cron expression is updated directly in cron.job table then job starts on time.
I suspect that it could be caching issue. Something from context of first job is used when sub-jobs are scheduled.
When job cron expression is updated manually then cache is invalidated and job is picked up.

@juvies
Copy link
Author

juvies commented Nov 5, 2024

Job scheduled from other job starts on time if scheduled using dblink.

@juvies
Copy link
Author

juvies commented Dec 3, 2024

The DBLINK solution did not resolve the issue, as the problem reappears after some time.

Upon further debugging, I observed that the job cache is not being refreshed and the RefreshTaskHash method is not invoked. The InvalidateJobCacheCallback is still being triggered frequently and setting CronJobCacheValid to false, which should signal the main loop to call RefreshTaskHash. However, in the main loop, CronJobCacheValid always remains true, as though it is operating on a different instance.

As a temporary fix, I decided to bypass CronJobCacheValid entirely and call RefreshTaskHash at regular intervals.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant