citusdata / pg_cron

Run periodic jobs in PostgreSQL
PostgreSQL License
2.9k stars 195 forks source link

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

Open juvies opened 3 weeks ago

juvies commented 3 weeks ago

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 commented 3 weeks ago

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