- Version: v6.8.0
- Platform: ?
- Subsystem: timers
See: TryGhost/Ghost#7555
Moving from: #8655 (comment)
Regression from timers: improve setImmediate() performance (#8655)
Hey there!
We started having test failures due to this change. There's more information on the issue & PR linked just above this comment. To pull some of that here:
The last job never get's executed, because setImmediate does not get triggered!
We have a temporary fix in place in the PR, that reduces the timeout and this appears to work (the tests pass). Would love a little bit of input into how this change has impacted the functionality and whether we've found a bug or are doing something wrong :)
varjobs=[Date.now()+1000,Date.now()+2000,Date.now()+3000];jobs.forEach(function(timestamp){vartimeout=setTimeout(function(){clearTimeout(timeout);(functionretry(){varimmediate=setImmediate(function(){clearImmediate(immediate);if(Date.now()<timestamp){returnretry();}console.log("FINISHED JOB");});}());},timestamp-200);});v6.8.0 - does not work, you will see 1 x FINISHED JOB
v4.4.7 && v6.7.0 - works as expected, you will see 3 x FINISHED JOB
cc @ErisDS, @thealphanerd, @mscdex, @Trott, @kirrg001
See: TryGhost/Ghost#7555
Moving from: #8655 (comment)
Regression from
timers: improve setImmediate() performance(#8655)cc @ErisDS, @thealphanerd, @mscdex, @Trott, @kirrg001