-
Notifications
You must be signed in to change notification settings - Fork 717
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
After idling some hours the scheduler returns "running", accepts jobs, but refuses to execute them when "run_date" arrives #283
Comments
Have you read the "Troubleshooting" section of the docs? |
If I raise the logger level, is there anything more to config? Do I have to call the logger to output more? |
No, simply raising the logger level should be fine. You should be seeing plenty of additional info then. |
Now I have set the logging level and tested: nothing. At the moment of planified job, when the job is due, nothing happened and nothing in log. Some details: I have configured Checking the logs of yesterday, at 2330, this error happened:
We can see that it happens inside And then, at 0900 and 0950, this error does not appear in log, and jobs not executed. Before that, I have tried without How I added the job:
callable:
The exeption was:
I think, before the execution of job, APScheduler should wake the connection to DB, to assure that if we want to retrieve persisted data of jobs, we have a living connection. I know Django has a problem of "after some idle time, the connection with DB dies and the first coming requests fails", but I am not sure if it is related. Even that, I think APScheduler should wake somehow, because I may planify a job after 3 days and setting the I have seen a somehow similar issue #228, but I don't know how to apply the config with |
MySQL has been known to have issues like that, depending on the driver. But what worries me more is that for some reason the scheduler is trying to iterate over |
Interestingly, if I don't use I mean, instead of doing:
I do:
And the job gets executed. I think by importing the module Django reestablish the connection with DB and then enable the connection for APScheduler again. By the way, in order to avoid waiting for one day to test the scheduler's activity, you can reproduce by:
You can see the same error in log. But, if we don't specify the jobstore persistency, we have no way to track jobs if apache/mariadb/the machine restarts. I have reported an issue to |
Confirmed: The DB connection is the problem. I have reported the issue to With or without any persistent jobstore, to avoid this issue, in the callable of the job, you have to import Django models and do
So that even the DB connection dies, I make Django to reconnect first, because Django manages the connection automatically. Now I think you can close the issue. Thanks. |
I find that if I keep Apscheduler busy, i.e., keep adding jobs to it, it will stay happy and active. But, if I leave it without job for a time, say, 12 hours or more, and add job again, even it is running (
scheduler.state
returns1
, which isRUNNING
, when I consult with a web service), it accepts job, but does not execute it, when therun_date
arrives.I am using APScheduler along with Apache and Django.
APScheduler is running in the web app in Apache, not in another process.
I tried using
django-apscheduler (0.2.3)
and without it, and the result is the same.Some code:
The text was updated successfully, but these errors were encountered: