-
Notifications
You must be signed in to change notification settings - Fork 622
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
Some jobs will be skipped in some cases #315
Comments
It's been a while, but I believe that we had originally written the code the way you are suggesting here. There were some issues with it and so it got reworked along with a bunch of other code in the process. I'm happy to revisit this mechanism at some point because I agree that it should be more reliable than what you are describing. I'll keep the ticket open for the rare chance I get time and can work on it or so that someone else can jump in and pr it. |
In my opinion, this should be at least documented. I was checking why some of my cron jobs don't start, and accidentally bumped into this discussion. |
I have the same issue. I added more than 20 schedule in some cases it execute and others not. |
Same here, I have 7 jobs and randomly some jobs are sometimes skipped |
Any updates on this issue? I'm comparing between cron, node-schedule, agenda and bull. Should I drop cron because of this issue? |
One weird behavior I noticed is that for some reason, when the I run the following pattern:
Output:
|
@kbbgl are you using a specific timezone with that cron string? |
@jodevsa it's variable, dependent on the timezone of the client. |
@kbbgl It would really help in figuring out what exactly is happening. I'm getting the following output from running this :
output: |
Is anyone still seeing this issue? We've since pushed a couple changes up to v1.5.0. Please review on that version. This sounds similar to GH-385, but I'm not certain at the moment and am having a hard time reproducing the code in there. Let us know, thanks. |
I'm still having this issue. |
@codypace68 which version of the module, node, and so forth? Also, can you share the cron syntax and a example of how you're using it? |
We have the same issue with v8.15.0 of nodejs and v1.5.0 of the lib. It is hard to reproduce I think. It seems to skip launch when the date is over (for example because an IO use the process at the time when the cron have to valid). |
I am missing a job once in a while as well. |
Had the same problem. There seems to be an issue if you start several jobs "simultaneously" (in a short period of time). In my case, I had to switch to node-cron, who works well in that scenario. |
Same issue, I going to node-schedule :( |
Any updates on that? It's been a while.. |
the callback intervals should be longer than 1 second, I believe they are as long as the full time between executions unless the execution time is more than a month away. if anyone is still having this issue could you make a test case for it following the conventions here? https://github.com/kelektiv/node-cron/blob/master/tests/cron.test.js |
In my case, if multiple jobs are scheduled at the exactly the same time, some might be skipped. By looking at the code, I see that each task has a 1000-millisecond interval callback all the times, and at each call, if the current time matches, the job runs. Sometimes, when multiple jobs are called at the same second, and plus slow CPU or heavy task or slow nodejs or the callback happens to be at the very end of that second, some of them might skipped the second 0 (if the second is not set, it will default to 0) and they will not run. In other words, this mechanism is very unreliable.
I don't see any quick fix for this. I think the best way is the node-scheduler way, which calculate the next running time for each task and set only one callback (instead of call every second which consumes CPU).
If you are using this for serious jobs like the cron replacement in a server, I highly recommend you to switch another lib. I think the author should state this in the README since it might cause serious problems and hard to find out why.
The text was updated successfully, but these errors were encountered: