{"action":"created","issue":{"url":"https://api.github.com/repos/nodejs/node/issues/5964","repository_url":"https://api.github.com/repos/nodejs/node","labels_url":"https://api.github.com/repos/nodejs/node/issues/5964/labels{/name}","comments_url":"https://api.github.com/repos/nodejs/node/issues/5964/comments","events_url":"https://api.github.com/repos/nodejs/node/issues/5964/events","html_url":"https://github.com/nodejs/node/pull/5964","id":144743980,"number":5964,"title":"node: call set_trace_sync_io before bootstrap","user":{"login":"joshgav","id":4421720,"avatar_url":"https://avatars.githubusercontent.com/u/4421720?v=3","gravatar_id":"","url":"https://api.github.com/users/joshgav","html_url":"https://github.com/joshgav","followers_url":"https://api.github.com/users/joshgav/followers","following_url":"https://api.github.com/users/joshgav/following{/other_user}","gists_url":"https://api.github.com/users/joshgav/gists{/gist_id}","starred_url":"https://api.github.com/users/joshgav/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshgav/subscriptions","organizations_url":"https://api.github.com/users/joshgav/orgs","repos_url":"https://api.github.com/users/joshgav/repos","events_url":"https://api.github.com/users/joshgav/events{/privacy}","received_events_url":"https://api.github.com/users/joshgav/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/nodejs/node/labels/c++","name":"c++","color":"e11d21"},{"url":"https://api.github.com/repos/nodejs/node/labels/lib%20/%20src","name":"lib / src","color":"fad8c7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2016-03-30T23:03:15Z","updated_at":"2016-03-31T20:49:29Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/nodejs/node/pulls/5964","html_url":"https://github.com/nodejs/node/pull/5964","diff_url":"https://github.com/nodejs/node/pull/5964.diff","patch_url":"https://github.com/nodejs/node/pull/5964.patch"},"body":"### Pull Request check-list\r\n\r\n- [x] Does `make -j8 test` (UNIX) or `vcbuild test nosign` (Windows) pass with\r\n  this change (including linting)?\r\n- [x] Is the commit message formatted according to [CONTRIBUTING.md][0]?\r\n- [ ] If this change fixes a bug (or a performance problem), is a regression\r\n  test (or a benchmark) included?\r\n\r\n### Affected core subsystem(s)\r\n\r\nnode --trace-sync-io\r\n\r\n### Description of change\r\n\r\n`env->set_trace_sync_io` was previously being called after `node::LoadEnvironment` so it wasn't in effect for the initial script."},"comment":{"url":"https://api.github.com/repos/nodejs/node/issues/comments/204121406","html_url":"https://github.com/nodejs/node/pull/5964#issuecomment-204121406","issue_url":"https://api.github.com/repos/nodejs/node/issues/5964","id":204121406,"user":{"login":"trevnorris","id":289174,"avatar_url":"https://avatars.githubusercontent.com/u/289174?v=3","gravatar_id":"","url":"https://api.github.com/users/trevnorris","html_url":"https://github.com/trevnorris","followers_url":"https://api.github.com/users/trevnorris/followers","following_url":"https://api.github.com/users/trevnorris/following{/other_user}","gists_url":"https://api.github.com/users/trevnorris/gists{/gist_id}","starred_url":"https://api.github.com/users/trevnorris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trevnorris/subscriptions","organizations_url":"https://api.github.com/users/trevnorris/orgs","repos_url":"https://api.github.com/users/trevnorris/repos","events_url":"https://api.github.com/users/trevnorris/events{/privacy}","received_events_url":"https://api.github.com/users/trevnorris/received_events","type":"User","site_admin":false},"created_at":"2016-03-31T20:49:29Z","updated_at":"2016-03-31T20:49:29Z","body":"First, yes, it is supposed to run after bootstrap. From `node -h`:\r\n```\r\n  --trace-sync-io       show stack trace when use of sync IO\r\n                        is detected after the first tick\r\n```\r\nReasons for this:\r\n1) `require()` is a sync I/O operation. So we would have to special case this in order to not print a warning for every use of `require()`.\r\n2) It is common practice to load resources synchronously during bootstrap so that they are available when/if other modules `require` them.\r\n\r\nHave you tried running `./node --trace-sync-io script.js` where the script is an empty file? You'll see that there's a lot of output."}}