-
Notifications
You must be signed in to change notification settings - Fork 97
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
Why does job not go from Started Execution to Executed #30
Comments
After this happens, jobs supposed to happen later either show up sometimes, or they just don't. |
I'm having a similar issue. Each job seems to run twice, one never makes it out of Started Execution state, the other usually makes it to Executed state. I have Django running behind Gunicorn, so I had to use this hack to get it to only run on the master node and not on the workers. The scheduler is initialized at the bottom of the wsgi.py file. Otherwise, it follows the above StackOverflow method to avoid the APScheduler running on every node. |
hey @Juanjoorrego @AnthonyBRoberts have you been able to figure out what was the issue ? i'm having exactly same problem as you... |
hello, I am also having the issue both while using the django runserver in local or using uwsgi in production, my jobs are run as many times there are processes running django. @jarekwg I have what seems to be a fix by adding a lock in the
Could this be a proper fix according to you ? |
this could also fix #12 |
Hi @sdementen,
Either way, probs won't merge a change like this myself as I'm too far removed at this point. Would you (or anyone else here) be interested in helping maintain this package? Happy to grant write access. |
I think locking the _get_jobs is not enough as the update of the jobs is done in a 2nd phase in APScheduler. And between a first call of _get_jobs and a second call of _get_jobs , the update job may not have happened yet leading the second call of _get_jobs to return the same jobs as the first call ==> there is a need to mark the job as "read" in _get_jobs (what I do with setting the I can do a PR and update the tests/docs if needed. For the maintenance, I can help if you want (even though I have not a deep knowledge of APScheduler) but I do not feel I can take it over on the LT (not in my core or secondary focus, more my third...) |
Hmm, so your idea of somehow marking the DjangoJobs as already queued is sound, however doing this by wiping the
I'm not familiar w the code anymore, but could |
Indeed, it felt to me like a hack too. |
Most job runners have a status field that includes this, plus other aspects of the Job life cycle. eg. PENDING, QUEUED, RUNNING, SUCCESS, FAILURE |
Fixed via #86. |
Hi there,
I have noticed that some jobs never go from Started Execution to Executed for some reason. There is no clear bug, it just happens. Is there a reason for this?
The text was updated successfully, but these errors were encountered: