Apscheduler misfire_grace_time

1,024 views
Skip to first unread message

Oded Bd

unread,
Feb 7, 2017, 5:20:27 PM2/7/17
to APScheduler
I'm trying to set grace time, because it's really important that those jobs will run.
but it seems that this configuration is ignored, I get this message at the logs

grace_time = 15 * 60
_g_aps_default_sql_config = {
'apscheduler.misfire_grace_time': grace_time,
'apscheduler.coalesce': True,
'apscheduler.daemonic': True,
'apscheduler.standalone': True,
__jbs_class: __jbs_sqlalchemy,
__jbs_url: __db_url,
__jbs_table: __jbs_tn
}
sched = BackgroundScheduler()
sched.configure(gconfig=_g_aps_default_sql_config, misfire_grace_time=grace_time)




2017-02-07 18:00:00;WARNING;Error getting due jobs from job store 'default': (_mysql_exceptions.OperationalError) (2006, 'MySQL server has gone away') [SQL: u'SELECT apscheduler_jobs.id, apscheduler_jobs.job_state \nFROM apscheduler_jobs
 \nWHERE apscheduler_jobs.next_run_time <= %s ORDER BY apscheduler_jobs.next_run_time'
] [parameters: (1486483200.08516,)]
2017-02-07 18:00:00;DEBUG;Next wakeup is due at 2017-02-07 18:00:10.085160+02:00 (in 10.000000 seconds)
2017-02-07 18:00:10;DEBUG;Looking for jobs to run
2017-02-07 18:00:10;WARNING;Run time of job "send_sched_data_to_srkrk (trigger: cron[day_of_week='1', hour='18', minute='0'], next run at: 2017-02-14 18:00:00 IST)" was missed by 0:00:10.409230
2017-02-07 18:00:10;WARNING;Run time of job "send_sched_data_to_srkrk (trigger: cron[day_of_week='1', hour='18', minute='0'], next run at: 2017-02-07 18:00:00 IST)" was missed by 0:00:10.470806
2017-02-07 18:00:10;WARNING;Run time of job "send_sched_data_to_srkrk (trigger: cron[day_of_week='1', hour='18', minute='0'], next run at: 2017-02-07 18:00:00 IST)" was missed by 0:00:10.486162
2017-02-07 18:00:10;WARNING;Run time of job "send_sched_data_to_srkrk (trigger: cron[day_of_week='1', hour='18', minute='0'], next run at: 2017-02-07 18:00:00 IST)" was missed by 0:00:10.493710
2017-02-07 18:00:10;WARNING;Run time of job "send_sched_data_to_srkrk (trigger: cron[day_of_week='1', hour='18', minute='0'], next run at: 2017-02-14 18:00:00 IST)" was missed by 0:00:10.519279


Do you have any idea?

Alex Grönholm

unread,
Feb 7, 2017, 5:33:02 PM2/7/17
to apsch...@googlegroups.com

As the default misfire_grace_time is just 1 second and seems to be set to 10 seconds here, you are definitely setting it somewhere. Are you absolutely sure that your jobs don't have it explicitly set to this value?

--
You received this message because you are subscribed to the Google Groups "APScheduler" group.
To unsubscribe from this group and stop receiving emails from it, send an email to apscheduler...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Oded Bd

unread,
Feb 8, 2017, 3:05:52 PM2/8/17
to APScheduler
I have this line
sched.configure(misfire_grace_time=1000)
Isn't it's should change the default grace time?


בתאריך יום רביעי, 8 בפברואר 2017 בשעה 00:33:02 UTC+2, מאת Alex Grönholm:

Alex Grönholm

unread,
Feb 8, 2017, 3:37:41 PM2/8/17
to apsch...@googlegroups.com

Yes. But the scheduler doesn't pull that 10 seconds out of thin air. It's coming from somewhere. Note that changing the default has no effect on existing jobs.

Reply all
Reply to author
Forward
0 new messages