Repository navigation
setImmediate regression in v6.8.0 #9084
Copy link
Copy link
Closed
Labels
confirmed-bugIssues and PRs for confirmed bugs.Issues and PRs for confirmed bugs.timersIssues and PRs related to timers, setImmediate(), setInterval(), and setTimeout().Issues and PRs related to timers, setImmediate(), setInterval(), and setTimeout().
Description
Activity
- addedtimersIssues and PRs related to timers, setImmediate(), setInterval(), and setTimeout().Issues and PRs related to timers, setImmediate(), setInterval(), and setTimeout().
on Oct 13, 2016 - changed the title
[-]SetImmediate regression in v6.8.0[/-][+]setImmediate regression in v6.8.0[/+]on Oct 13, 2016 - addedconfirmed-bugIssues and PRs for confirmed bugs.Issues and PRs for confirmed bugs.
on Oct 13, 2016 Smells like a problem with the new linkedlist bits but I'm having a hard time pinpointing it from the diff.
Hint: it works correctly if the
clearImmediate(immediate);line is removed.Reacted by kirrg001This looks like it could be related to the re-ordering of timers and immediates.
Take this code:
setTimeout(() => {console.log('foo')}, 1); setImmediate(() => {console.log('bar')}); setTimeout(() => {console.log('foo')}, 1); setImmediate(() => {console.log('bar')});
In 6.7.0, it usually (but not always!) returns:
bar bar foo foo
But in 6.8.0, it usually (but not always!) returns:
foo foo bar bar
Docs say
setImmediate()should fire before timers, so if I'm understanding correctly, the typical results in 6.8.0 are a bug, albeit a bug that sometimes shows up in 6.7.0?"if I'm understanding correctly" may be a big assumption here...
Let's revert the change and pinpoint the issue after.
I have a fix coming shortly.
Reacted by Rich Trott and Hannah WolfeProposed fix: #9086
- added 2 commits that reference this issue
on Oct 14, 2016 - added a commit that references this issue
on Oct 17, 2016 - added a commit that references this issue
on Jul 27, 2026
Metadata
Metadata
Assignees
Labels
confirmed-bugIssues and PRs for confirmed bugs.Issues and PRs for confirmed bugs.timersIssues and PRs related to timers, setImmediate(), setInterval(), and setTimeout().Issues and PRs related to timers, setImmediate(), setInterval(), and setTimeout().
See: TryGhost/Ghost#7555
Moving from: #8655 (comment)
Regression from
timers: improve setImmediate() performance(#8655)cc @ErisDS, @thealphanerd, @mscdex, @Trott, @kirrg001