{"action":"created","issue":{"url":"https://api.github.com/repos/iojs/io.js/issues/1231","labels_url":"https://api.github.com/repos/iojs/io.js/issues/1231/labels{/name}","comments_url":"https://api.github.com/repos/iojs/io.js/issues/1231/comments","events_url":"https://api.github.com/repos/iojs/io.js/issues/1231/events","html_url":"https://github.com/iojs/io.js/pull/1231","id":63426903,"number":1231,"title":"timers: assure setTimeout callback only runs once","user":{"login":"silverwind","id":115237,"avatar_url":"https://avatars.githubusercontent.com/u/115237?v=3","gravatar_id":"","url":"https://api.github.com/users/silverwind","html_url":"https://github.com/silverwind","followers_url":"https://api.github.com/users/silverwind/followers","following_url":"https://api.github.com/users/silverwind/following{/other_user}","gists_url":"https://api.github.com/users/silverwind/gists{/gist_id}","starred_url":"https://api.github.com/users/silverwind/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/silverwind/subscriptions","organizations_url":"https://api.github.com/users/silverwind/orgs","repos_url":"https://api.github.com/users/silverwind/repos","events_url":"https://api.github.com/users/silverwind/events{/privacy}","received_events_url":"https://api.github.com/users/silverwind/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/iojs/io.js/labels/timers","name":"timers","color":"f7c6c7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-03-21T17:00:13Z","updated_at":"2015-03-25T17:35:46Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/iojs/io.js/pulls/1231","html_url":"https://github.com/iojs/io.js/pull/1231","diff_url":"https://github.com/iojs/io.js/pull/1231.diff","patch_url":"https://github.com/iojs/io.js/pull/1231.patch"},"body":"This fixes #1191 by adding a property to track if the callback was run, and if so, prevents it from running again during a `.unref()`.\r\n\r\nI woul've loved to do it without the property, but couldn't find any way to find out whether the callback already ran.\r\n\r\nr=@bnoordhuis @trevnorris"},"comment":{"url":"https://api.github.com/repos/iojs/io.js/issues/comments/86135617","html_url":"https://github.com/iojs/io.js/pull/1231#issuecomment-86135617","issue_url":"https://api.github.com/repos/iojs/io.js/issues/1231","id":86135617,"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":"2015-03-25T17:35:46Z","updated_at":"2015-03-25T17:35:46Z","body":"This is more related to #1152 / #1151 than initially thought.\r\n\r\nFailing test:\r\n\r\n```js\r\nvar assert = require('assert');\r\n\r\nsetImmediate(function () {\r\n  var count = 0;\r\n  while (count++ < 1e7) {\r\n    Math.random()\r\n  }\r\n});\r\n\r\nvar i = setTimeout(function () {\r\n  this.unref();\r\n  setImmediate(process.exit);\r\n}, 10);\r\n// i.unref();\r\n\r\nprocess.on('exit', function() {\r\n  assert.deepStrictEqual(process._getActiveHandles(), []);\r\n});\r\n```"}}