-
Notifications
You must be signed in to change notification settings - Fork 627
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
Random hangs #141
Comments
Interesting, I'll take a look when I get a chance. Thanks. |
I can confirm that we are seeing the same issue. We have a cron that runs every 10 seconds that we started logging and since upgrading to 1.0.6 it will just randomly stop firing after a few hours. There are no error messages or anything else I can see to explain why it stops. |
Looks like that's true |
Ok, thanks for the notes. |
I'm still having issues reproducing this...what version of node are you on?
Also, would you agree this is an acceptable test to try to reproduce what you're seeing (simulated onTicks that is). The reason for simulated is that if it's a problem with the module then the onTicks should not work as expected. If it's a problem with timers or something similar then that's probably a node/iojs issue... |
We are using Node 0.10.36 and the only difference was going from 1.0.5 to 1.0.6 and then back to fix it. The cron job that was having the issues for us was this one: new CronJob('*/10 * * * * *', function() {
console.log('onTick');
// ....
}, null, true); This would run for several hours and then would just stop firing (I don't know if it was the same length of time each time). |
We are using Node 0.10.33. Reverting back to node-cron 1.0.5 fixes the issue. |
Ok. I'll see if I can try to reproduce it here. |
I ran your test without sinon simulated clock ticks modified like: var CronJob = require('cron').CronJob;
//var sinon = require('sinon');
//var clock = sinon.useFakeTimers();
var previous = 0;
var counter = 0;
var cronSyncSchedule = '*/1 * * * * *';
var scheduleJob = new CronJob(cronSyncSchedule, function() {
counter++;
checkCounter();
}, function() {
}, true, null);
//clock.tick(24*60*60*1000);
function checkCounter() {
console.log(counter + ' - ' + previous);
if (counter != (previous + 1))
console.log('SKIPPED: ' + (counter - 1) + ", COUNTER: " + counter);
previous = counter;
}
//clock.restore(); It ended up stuck on It didn't exit, just stopped. |
I have the same problem. it will stop after run for about 16000 times. |
Does the incomplete function fire for any of you? Also, are any of you
|
Oncomplete not incomplete...
|
+1 experienced this last night, we are on |
+1 , interestingly from our log, we had a rule for 00 * * * * *, it kept firing every minute at exact ##:##:00 for 3 days until the last event when it stoppped with log at timestamp ##:##:01 |
I have been having a similar issue in my own code and was about to switch to Cron when I saw this defect. From what I can tell this is something to do with the latest versions of Node and the way setTimeout/nextTick work. Deep inside error reports you will get something about recursion. Apparently setTimeout isn't a tailed method anymore. To work around try wrapping all setTimeout's in setImmediate:
At least this seems to work. |
Confirm, after several hours some of my crons stop working |
Cron stops working in function start() if fallen in
because sometime cronTime.getTimeout() return -1 for some reason
output: getTimeout 1424777178994 1424777177994 1000 1000 problem in sendAt()
|
I just pushed a new version of the module with GH-141, this should take care of the hang issues you're seeing. Please post back if not and I can reopen. |
Unfortunately this issue is occurring again using node 0.12.5 and node-cron 1.0.9. Running the crons from 1 to 2 sec intervals like */2 * * * * * |
Is this fixed on 1.3? On 1.1 I'm still having the problem. |
After updating to 1.0.6, the cron will randomly hang and not fire. I have it set to run every second and at random times, hours in, it will just hang and the cron will not fire anymore. It's hard to reproduce except waiting for a long period of time. Maybe you could possibly see a scenario in which that could happen.
It will end up stuck on:
...
Count: 14565
Count: 14566
Count: 14567
or similiar
The text was updated successfully, but these errors were encountered: