{"action":"created","comment":{"url":"https://api.github.com/repos/nodejs/node/pulls/comments/48751030","id":48751030,"diff_hunk":"@@ -253,6 +253,8 @@ Any specified file descriptor has to have been opened for appending.\n \n _Note: Specified file descriptors will not be closed automatically._\n \n+_Note: Do not use `appendFile` to write to a single file from multiple places in an application.  It will open a file descriptor *per call*, not one *per file*.  (Non-specified) file descriptors are closed automatically, but will stay open for milliseconds on a busy host.  Under non-trivial load, the application will quickly exceed the number of file descriptors allowed by the OS, causing seemingly unrelated file and network failures. ","path":"doc/api/fs.markdown","position":4,"original_position":4,"commit_id":"d8deb20f2a814568641d6dfe92cbbff37aa8add6","original_commit_id":"d8deb20f2a814568641d6dfe92cbbff37aa8add6","user":{"login":"sam-github","id":17607,"avatar_url":"https://avatars.githubusercontent.com/u/17607?v=3","gravatar_id":"","url":"https://api.github.com/users/sam-github","html_url":"https://github.com/sam-github","followers_url":"https://api.github.com/users/sam-github/followers","following_url":"https://api.github.com/users/sam-github/following{/other_user}","gists_url":"https://api.github.com/users/sam-github/gists{/gist_id}","starred_url":"https://api.github.com/users/sam-github/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sam-github/subscriptions","organizations_url":"https://api.github.com/users/sam-github/orgs","repos_url":"https://api.github.com/users/sam-github/repos","events_url":"https://api.github.com/users/sam-github/events{/privacy}","received_events_url":"https://api.github.com/users/sam-github/received_events","type":"User","site_admin":false},"body":"what's special about multiple places? the problem described can occur if you use this from one place, what you are describing seems overly specific to your application. I think it would be better to say something like \"Allocates a file descriptor briefly for each call. This is not as efficient as opening the file once in \"append mode\", in that it continually opens and closes a fd for (possibly) a single file, and if called in a heavily parallel application may even cause the process wide descriptor limits to be hit.\"","created_at":"2016-01-04T16:46:54Z","updated_at":"2016-01-04T16:46:54Z","html_url":"https://github.com/nodejs/node/pull/4288#discussion_r48751030","pull_request_url":"https://api.github.com/repos/nodejs/node/pulls/4288","_links":{"self":{"href":"https://api.github.com/repos/nodejs/node/pulls/comments/48751030"},"html":{"href":"https://github.com/nodejs/node/pull/4288#discussion_r48751030"},"pull_request":{"href":"https://api.github.com/repos/nodejs/node/pulls/4288"}}},"pull_request":{"url":"https://api.github.com/repos/nodejs/node/pulls/4288","id":53676382,"html_url":"https://github.com/nodejs/node/pull/4288","diff_url":"https://github.com/nodejs/node/pull/4288.diff","patch_url":"https://github.com/nodejs/node/pull/4288.patch","issue_url":"https://api.github.com/repos/nodejs/node/issues/4288","number":4288,"state":"open","locked":false,"title":"Warn against use of appendFile for writing to a single file.","user":{"login":"chrisdew","id":24795,"avatar_url":"https://avatars.githubusercontent.com/u/24795?v=3","gravatar_id":"","url":"https://api.github.com/users/chrisdew","html_url":"https://github.com/chrisdew","followers_url":"https://api.github.com/users/chrisdew/followers","following_url":"https://api.github.com/users/chrisdew/following{/other_user}","gists_url":"https://api.github.com/users/chrisdew/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisdew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisdew/subscriptions","organizations_url":"https://api.github.com/users/chrisdew/orgs","repos_url":"https://api.github.com/users/chrisdew/repos","events_url":"https://api.github.com/users/chrisdew/events{/privacy}","received_events_url":"https://api.github.com/users/chrisdew/received_events","type":"User","site_admin":false},"body":"Warn against use of appendFile for writing to a single file from multiple places.\r\n\r\nThis unexpected behaviour brought down a production machine under load, where I was using `appendFile` for logging.  I don't want anyone else to make a similar mistake.","created_at":"2015-12-15T09:07:25Z","updated_at":"2016-01-04T16:46:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dcbc3452bccc6264775bf8fe678549f16e33635d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/nodejs/node/pulls/4288/commits","review_comments_url":"https://api.github.com/repos/nodejs/node/pulls/4288/comments","review_comment_url":"https://api.github.com/repos/nodejs/node/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nodejs/node/issues/4288/comments","statuses_url":"https://api.github.com/repos/nodejs/node/statuses/d8deb20f2a814568641d6dfe92cbbff37aa8add6","head":{"label":"chrisdew:patch-1","ref":"patch-1","sha":"d8deb20f2a814568641d6dfe92cbbff37aa8add6","user":{"login":"chrisdew","id":24795,"avatar_url":"https://avatars.githubusercontent.com/u/24795?v=3","gravatar_id":"","url":"https://api.github.com/users/chrisdew","html_url":"https://github.com/chrisdew","followers_url":"https://api.github.com/users/chrisdew/followers","following_url":"https://api.github.com/users/chrisdew/following{/other_user}","gists_url":"https://api.github.com/users/chrisdew/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisdew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisdew/subscriptions","organizations_url":"https://api.github.com/users/chrisdew/orgs","repos_url":"https://api.github.com/users/chrisdew/repos","events_url":"https://api.github.com/users/chrisdew/events{/privacy}","received_events_url":"https://api.github.com/users/chrisdew/received_events","type":"User","site_admin":false},"repo":{"id":48031234,"name":"node","full_name":"chrisdew/node","owner":{"login":"chrisdew","id":24795,"avatar_url":"https://avatars.githubusercontent.com/u/24795?v=3","gravatar_id":"","url":"https://api.github.com/users/chrisdew","html_url":"https://github.com/chrisdew","followers_url":"https://api.github.com/users/chrisdew/followers","following_url":"https://api.github.com/users/chrisdew/following{/other_user}","gists_url":"https://api.github.com/users/chrisdew/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisdew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisdew/subscriptions","organizations_url":"https://api.github.com/users/chrisdew/orgs","repos_url":"https://api.github.com/users/chrisdew/repos","events_url":"https://api.github.com/users/chrisdew/events{/privacy}","received_events_url":"https://api.github.com/users/chrisdew/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/chrisdew/node","description":"Node.js JavaScript runtime :sparkles::turtle::rocket::sparkles:","fork":true,"url":"https://api.github.com/repos/chrisdew/node","forks_url":"https://api.github.com/repos/chrisdew/node/forks","keys_url":"https://api.github.com/repos/chrisdew/node/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chrisdew/node/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chrisdew/node/teams","hooks_url":"https://api.github.com/repos/chrisdew/node/hooks","issue_events_url":"https://api.github.com/repos/chrisdew/node/issues/events{/number}","events_url":"https://api.github.com/repos/chrisdew/node/events","assignees_url":"https://api.github.com/repos/chrisdew/node/assignees{/user}","branches_url":"https://api.github.com/repos/chrisdew/node/branches{/branch}","tags_url":"https://api.github.com/repos/chrisdew/node/tags","blobs_url":"https://api.github.com/repos/chrisdew/node/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chrisdew/node/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chrisdew/node/git/refs{/sha}","trees_url":"https://api.github.com/repos/chrisdew/node/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chrisdew/node/statuses/{sha}","languages_url":"https://api.github.com/repos/chrisdew/node/languages","stargazers_url":"https://api.github.com/repos/chrisdew/node/stargazers","contributors_url":"https://api.github.com/repos/chrisdew/node/contributors","subscribers_url":"https://api.github.com/repos/chrisdew/node/subscribers","subscription_url":"https://api.github.com/repos/chrisdew/node/subscription","commits_url":"https://api.github.com/repos/chrisdew/node/commits{/sha}","git_commits_url":"https://api.github.com/repos/chrisdew/node/git/commits{/sha}","comments_url":"https://api.github.com/repos/chrisdew/node/comments{/number}","issue_comment_url":"https://api.github.com/repos/chrisdew/node/issues/comments{/number}","contents_url":"https://api.github.com/repos/chrisdew/node/contents/{+path}","compare_url":"https://api.github.com/repos/chrisdew/node/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chrisdew/node/merges","archive_url":"https://api.github.com/repos/chrisdew/node/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chrisdew/node/downloads","issues_url":"https://api.github.com/repos/chrisdew/node/issues{/number}","pulls_url":"https://api.github.com/repos/chrisdew/node/pulls{/number}","milestones_url":"https://api.github.com/repos/chrisdew/node/milestones{/number}","notifications_url":"https://api.github.com/repos/chrisdew/node/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chrisdew/node/labels{/name}","releases_url":"https://api.github.com/repos/chrisdew/node/releases{/id}","created_at":"2015-12-15T08:58:28Z","updated_at":"2015-12-15T08:58:36Z","pushed_at":"2015-12-15T09:06:11Z","git_url":"git://github.com/chrisdew/node.git","ssh_url":"git@github.com:chrisdew/node.git","clone_url":"https://github.com/chrisdew/node.git","svn_url":"https://github.com/chrisdew/node","homepage":"https://nodejs.org","size":163106,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"nodejs:master","ref":"master","sha":"ac153bd2a6f45e5dedebacab362135a82ac08dbd","user":{"login":"nodejs","id":9950313,"avatar_url":"https://avatars.githubusercontent.com/u/9950313?v=3","gravatar_id":"","url":"https://api.github.com/users/nodejs","html_url":"https://github.com/nodejs","followers_url":"https://api.github.com/users/nodejs/followers","following_url":"https://api.github.com/users/nodejs/following{/other_user}","gists_url":"https://api.github.com/users/nodejs/gists{/gist_id}","starred_url":"https://api.github.com/users/nodejs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nodejs/subscriptions","organizations_url":"https://api.github.com/users/nodejs/orgs","repos_url":"https://api.github.com/users/nodejs/repos","events_url":"https://api.github.com/users/nodejs/events{/privacy}","received_events_url":"https://api.github.com/users/nodejs/received_events","type":"Organization","site_admin":false},"repo":{"id":27193779,"name":"node","full_name":"nodejs/node","owner":{"login":"nodejs","id":9950313,"avatar_url":"https://avatars.githubusercontent.com/u/9950313?v=3","gravatar_id":"","url":"https://api.github.com/users/nodejs","html_url":"https://github.com/nodejs","followers_url":"https://api.github.com/users/nodejs/followers","following_url":"https://api.github.com/users/nodejs/following{/other_user}","gists_url":"https://api.github.com/users/nodejs/gists{/gist_id}","starred_url":"https://api.github.com/users/nodejs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nodejs/subscriptions","organizations_url":"https://api.github.com/users/nodejs/orgs","repos_url":"https://api.github.com/users/nodejs/repos","events_url":"https://api.github.com/users/nodejs/events{/privacy}","received_events_url":"https://api.github.com/users/nodejs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nodejs/node","description":"Node.js JavaScript runtime :sparkles::turtle::rocket::sparkles:","fork":false,"url":"https://api.github.com/repos/nodejs/node","forks_url":"https://api.github.com/repos/nodejs/node/forks","keys_url":"https://api.github.com/repos/nodejs/node/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nodejs/node/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nodejs/node/teams","hooks_url":"https://api.github.com/repos/nodejs/node/hooks","issue_events_url":"https://api.github.com/repos/nodejs/node/issues/events{/number}","events_url":"https://api.github.com/repos/nodejs/node/events","assignees_url":"https://api.github.com/repos/nodejs/node/assignees{/user}","branches_url":"https://api.github.com/repos/nodejs/node/branches{/branch}","tags_url":"https://api.github.com/repos/nodejs/node/tags","blobs_url":"https://api.github.com/repos/nodejs/node/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nodejs/node/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nodejs/node/git/refs{/sha}","trees_url":"https://api.github.com/repos/nodejs/node/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nodejs/node/statuses/{sha}","languages_url":"https://api.github.com/repos/nodejs/node/languages","stargazers_url":"https://api.github.com/repos/nodejs/node/stargazers","contributors_url":"https://api.github.com/repos/nodejs/node/contributors","subscribers_url":"https://api.github.com/repos/nodejs/node/subscribers","subscription_url":"https://api.github.com/repos/nodejs/node/subscription","commits_url":"https://api.github.com/repos/nodejs/node/commits{/sha}","git_commits_url":"https://api.github.com/repos/nodejs/node/git/commits{/sha}","comments_url":"https://api.github.com/repos/nodejs/node/comments{/number}","issue_comment_url":"https://api.github.com/repos/nodejs/node/issues/comments{/number}","contents_url":"https://api.github.com/repos/nodejs/node/contents/{+path}","compare_url":"https://api.github.com/repos/nodejs/node/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nodejs/node/merges","archive_url":"https://api.github.com/repos/nodejs/node/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nodejs/node/downloads","issues_url":"https://api.github.com/repos/nodejs/node/issues{/number}","pulls_url":"https://api.github.com/repos/nodejs/node/pulls{/number}","milestones_url":"https://api.github.com/repos/nodejs/node/milestones{/number}","notifications_url":"https://api.github.com/repos/nodejs/node/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nodejs/node/labels{/name}","releases_url":"https://api.github.com/repos/nodejs/node/releases{/id}","created_at":"2014-11-26T19:57:11Z","updated_at":"2016-01-04T16:20:06Z","pushed_at":"2016-01-04T16:42:32Z","git_url":"git://github.com/nodejs/node.git","ssh_url":"git@github.com:nodejs/node.git","clone_url":"https://github.com/nodejs/node.git","svn_url":"https://github.com/nodejs/node","homepage":"https://nodejs.org","size":181018,"stargazers_count":18829,"watchers_count":18829,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2183,"mirror_url":null,"open_issues_count":666,"forks":2183,"open_issues":666,"watchers":18829,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nodejs/node/pulls/4288"},"html":{"href":"https://github.com/nodejs/node/pull/4288"},"issue":{"href":"https://api.github.com/repos/nodejs/node/issues/4288"},"comments":{"href":"https://api.github.com/repos/nodejs/node/issues/4288/comments"},"review_comments":{"href":"https://api.github.com/repos/nodejs/node/pulls/4288/comments"},"review_comment":{"href":"https://api.github.com/repos/nodejs/node/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nodejs/node/pulls/4288/commits"},"statuses":{"href":"https://api.github.com/repos/nodejs/node/statuses/d8deb20f2a814568641d6dfe92cbbff37aa8add6"}}}}