-
-
Notifications
You must be signed in to change notification settings - Fork 33.5k
Description
Node Version: 4.8.x
Linux METRICS03 4.15.0-1071-azure #76-Ubuntu SMP Wed Feb 12 03:02:44 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux-->
What steps will reproduce the bug?
- Set a timeout to call another function foo.
- Do some processing in foo and post processing set a timeout to call foo again.
It is observed that after numerous repetition foo doesn't get called at scheduled interval. Instead foo is called 3-4 hours later (sometimes even longer).
main() function is called when service starts.
`
var timerIntervalForJobProcess = 156060*1000;
main(){
processJob("abc")
}
var processJob = function(client){
logger.debug("in processJob");
processJobRecord(client)
.then(function (result) {
setNextExecutionForClient(client);
})
.catch(function (err) {
setNextExecutionForClient(client);
});
}
var setNextExecutionForClient = function (client) {
logger.info("Attempting to schedule job processing to execute again after " + timerIntervalForJobProcess + " milliseconds" + "for client: "+ client);
setTimeout(function(client) {
logger.info("in anonymous function in setNextExecutionForClient going to call processJob for client: "+ client);
processJob(client);
},
timerIntervalForJobProcess, client);
logger.info("Successfully scheduled job processing to execute again after " + timerIntervalForJobProcess + " milliseconds" + "for client: "+ client);
}`
How often does it reproduce? Is there a required condition?
It is happening approximately once in a week. Issue is observed randomly.
What is the expected behaviour?
Timeout scheduled function should execute close to 15 minutes. Few minut delay is okay but 3-4 hours of delay is not durable in the service.