jcass77 / django-apscheduler

APScheduler for Django
MIT License
669 stars 97 forks source link

skipped: maximum number of running instances reached #173

Closed CharlesFr closed 1 month ago

CharlesFr commented 2 years ago

I'm getting the following error which is strange given that I only have it defined once in my code, inside runapscheduler.py.

WARNING apscheduler.scheduler: Execution of job "update_payments (trigger: cron[hour='12'], next run at: 2022-10-09 12:00:00 UTC)" skipped: maximum number of running instances reached (1)

It seems to appear after 7 days of normal operation, and after it happens once it also happens on all my other jobs.

This is where the checks happens, how is it possible that the number of instances is being reached? https://github.com/jcass77/django-apscheduler/blob/a792c1a78881cca8bb38d47767713a74436c3c4a/django_apscheduler/jobstores.py#L57

jcass77 commented 1 month ago

The only explanation that I can think of is that there is an additional web server worker process running in the background somewhere.

Perhaps the 7-day cadence coincides with regular server maintenance, or backups? If so then those might not be cleanly shutting everything down.

Please reopen if you are still experiencing issues and have more to share.