{"action":"created","issue":{"url":"https://api.github.com/repos/nodejs/node/issues/9084","repository_url":"https://api.github.com/repos/nodejs/node","labels_url":"https://api.github.com/repos/nodejs/node/issues/9084/labels{/name}","comments_url":"https://api.github.com/repos/nodejs/node/issues/9084/comments","events_url":"https://api.github.com/repos/nodejs/node/issues/9084/events","html_url":"https://github.com/nodejs/node/issues/9084","id":182875110,"number":9084,"title":"setImmediate regression in v6.8.0","user":{"login":"Fishrock123","id":1093990,"avatar_url":"https://avatars.githubusercontent.com/u/1093990?v=3","gravatar_id":"","url":"https://api.github.com/users/Fishrock123","html_url":"https://github.com/Fishrock123","followers_url":"https://api.github.com/users/Fishrock123/followers","following_url":"https://api.github.com/users/Fishrock123/following{/other_user}","gists_url":"https://api.github.com/users/Fishrock123/gists{/gist_id}","starred_url":"https://api.github.com/users/Fishrock123/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fishrock123/subscriptions","organizations_url":"https://api.github.com/users/Fishrock123/orgs","repos_url":"https://api.github.com/users/Fishrock123/repos","events_url":"https://api.github.com/users/Fishrock123/events{/privacy}","received_events_url":"https://api.github.com/users/Fishrock123/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/nodejs/node/labels/confirmed-bug","name":"confirmed-bug","color":"fc2929"},{"url":"https://api.github.com/repos/nodejs/node/labels/timers","name":"timers","color":"f7c6c7"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-10-13T19:13:27Z","updated_at":"2016-10-13T19:28:59Z","closed_at":null,"body":"<!--\r\nThank you for reporting an issue.\r\nPlease fill in as much of the template below as you're able.\r\n\r\nVersion: output of `node -v`\r\nPlatform: output of `uname -a` (UNIX), or version and 32 or 64-bit (Windows)\r\nSubsystem: if known, please specify affected core module name\r\n\r\nIf possible, please provide code that demonstrates the problem, keeping it as\r\nsimple and free of external dependencies as you are able.\r\n-->\r\n\r\n* **Version**: v6.8.0\r\n* **Platform**: ?\r\n* **Subsystem**: timers\r\n\r\n<!-- Enter your issue details below this comment. -->\r\n\r\nSee: https://github.com/TryGhost/Ghost/issues/7555\r\nMoving from: https://github.com/nodejs/node/pull/8655#issuecomment-253453520\r\n\r\nRegression from [`timers: improve setImmediate() performance`](https://github.com/nodejs/node/commit/0ed8839a279ba2597ae9fc54517030b16116207d) (https://github.com/nodejs/node/pull/8655)\r\n\r\n> Hey there!\r\n\r\n> 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:\r\n\r\n>> The last job never get's executed, because setImmediate does not get triggered!\r\n\r\n> 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 :)\r\n\r\n--\r\n\r\n```js\r\nvar jobs = [Date.now() + 1000, Date.now() + 2000, Date.now() + 3000];\r\n\r\njobs.forEach(function(timestamp) {\r\n    var\ttimeout = setTimeout(function() {\r\n        clearTimeout(timeout);\r\n\r\n        (function retry() {\r\n            var immediate = setImmediate(function() {\r\n                clearImmediate(immediate);\r\n\r\n                if (Date.now() < timestamp) {\r\n                    return retry();\r\n                }\r\n\r\n                console.log(\"FINISHED JOB\");\r\n            });\r\n        }());\r\n    }, timestamp - 200);\r\n});\r\n```\r\n\r\n> `v6.8.0` - does not work, you will see 1 x FINISHED JOB\r\n> `v4.4.7 && v6.7.0` - works as expected, you will see 3 x FINISHED JOB\r\n\r\ncc @erisds, @TheAlphaNerd, @mscdex, @trott, @kirrg001\r\n"},"comment":{"url":"https://api.github.com/repos/nodejs/node/issues/comments/253614003","html_url":"https://github.com/nodejs/node/issues/9084#issuecomment-253614003","issue_url":"https://api.github.com/repos/nodejs/node/issues/9084","id":253614003,"user":{"login":"Fishrock123","id":1093990,"avatar_url":"https://avatars.githubusercontent.com/u/1093990?v=3","gravatar_id":"","url":"https://api.github.com/users/Fishrock123","html_url":"https://github.com/Fishrock123","followers_url":"https://api.github.com/users/Fishrock123/followers","following_url":"https://api.github.com/users/Fishrock123/following{/other_user}","gists_url":"https://api.github.com/users/Fishrock123/gists{/gist_id}","starred_url":"https://api.github.com/users/Fishrock123/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fishrock123/subscriptions","organizations_url":"https://api.github.com/users/Fishrock123/orgs","repos_url":"https://api.github.com/users/Fishrock123/repos","events_url":"https://api.github.com/users/Fishrock123/events{/privacy}","received_events_url":"https://api.github.com/users/Fishrock123/received_events","type":"User","site_admin":false},"created_at":"2016-10-13T19:28:59Z","updated_at":"2016-10-13T19:28:59Z","body":"Smells like a problem with the new linkedlist bits but I'm having a hard time pinpointing it from the diff."}}
{"actor":{"display_login":"Fishrock123"}}