{"action":"opened","number":227,"pull_request":{"url":"https://api.github.com/repos/basho/bitcask/pulls/227","id":52727220,"html_url":"https://github.com/basho/bitcask/pull/227","diff_url":"https://github.com/basho/bitcask/pull/227.diff","patch_url":"https://github.com/basho/bitcask/pull/227.patch","issue_url":"https://api.github.com/repos/basho/bitcask/issues/227","number":227,"state":"open","locked":false,"title":"has_valid_hintfile leaked a hintfile file descriptor.","user":{"login":"jonmeredith","id":64318,"avatar_url":"https://avatars.githubusercontent.com/u/64318?v=3","gravatar_id":"","url":"https://api.github.com/users/jonmeredith","html_url":"https://github.com/jonmeredith","followers_url":"https://api.github.com/users/jonmeredith/followers","following_url":"https://api.github.com/users/jonmeredith/following{/other_user}","gists_url":"https://api.github.com/users/jonmeredith/gists{/gist_id}","starred_url":"https://api.github.com/users/jonmeredith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonmeredith/subscriptions","organizations_url":"https://api.github.com/users/jonmeredith/orgs","repos_url":"https://api.github.com/users/jonmeredith/repos","events_url":"https://api.github.com/users/jonmeredith/events{/privacy}","received_events_url":"https://api.github.com/users/jonmeredith/received_events","type":"User","site_admin":false},"body":"The ```has_valid_hintfile``` function opened the file, then recursively called\r\n```hintfile_validate_loop``` until the end of file or error.  Either way\r\nit does not close the file.\r\n\r\n```has_valid_hintfile``` is called as part of opening a bitcask\r\nvia ```fold_keys(..., recovery, ...)``` via ```bitcask:scan_keyfiles/5```\r\nso the descriptors are leaked each time the bitcask is opened.\r\n\r\nFixed by adding a try/after block around the ```hintfile_validate_loop/3```\r\n\r\nPassed ```./rebar eunit``` locally\r\n\r\n```\r\n  All 95 tests passed.\r\n```","created_at":"2015-12-04T22:01:52Z","updated_at":"2015-12-04T22:01:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/basho/bitcask/pulls/227/commits","review_comments_url":"https://api.github.com/repos/basho/bitcask/pulls/227/comments","review_comment_url":"https://api.github.com/repos/basho/bitcask/pulls/comments{/number}","comments_url":"https://api.github.com/repos/basho/bitcask/issues/227/comments","statuses_url":"https://api.github.com/repos/basho/bitcask/statuses/52bce9c0bad9317534862cd3cdba56ba6b511f29","head":{"label":"basho:bugfix/jdm/leak-hintfile-fd-on-startup","ref":"bugfix/jdm/leak-hintfile-fd-on-startup","sha":"52bce9c0bad9317534862cd3cdba56ba6b511f29","user":{"login":"basho","id":176293,"avatar_url":"https://avatars.githubusercontent.com/u/176293?v=3","gravatar_id":"","url":"https://api.github.com/users/basho","html_url":"https://github.com/basho","followers_url":"https://api.github.com/users/basho/followers","following_url":"https://api.github.com/users/basho/following{/other_user}","gists_url":"https://api.github.com/users/basho/gists{/gist_id}","starred_url":"https://api.github.com/users/basho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/basho/subscriptions","organizations_url":"https://api.github.com/users/basho/orgs","repos_url":"https://api.github.com/users/basho/repos","events_url":"https://api.github.com/users/basho/events{/privacy}","received_events_url":"https://api.github.com/users/basho/received_events","type":"Organization","site_admin":false},"repo":{"id":632037,"name":"bitcask","full_name":"basho/bitcask","owner":{"login":"basho","id":176293,"avatar_url":"https://avatars.githubusercontent.com/u/176293?v=3","gravatar_id":"","url":"https://api.github.com/users/basho","html_url":"https://github.com/basho","followers_url":"https://api.github.com/users/basho/followers","following_url":"https://api.github.com/users/basho/following{/other_user}","gists_url":"https://api.github.com/users/basho/gists{/gist_id}","starred_url":"https://api.github.com/users/basho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/basho/subscriptions","organizations_url":"https://api.github.com/users/basho/orgs","repos_url":"https://api.github.com/users/basho/repos","events_url":"https://api.github.com/users/basho/events{/privacy}","received_events_url":"https://api.github.com/users/basho/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/basho/bitcask","description":"because you need another a key/value storage engine","fork":false,"url":"https://api.github.com/repos/basho/bitcask","forks_url":"https://api.github.com/repos/basho/bitcask/forks","keys_url":"https://api.github.com/repos/basho/bitcask/keys{/key_id}","collaborators_url":"https://api.github.com/repos/basho/bitcask/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/basho/bitcask/teams","hooks_url":"https://api.github.com/repos/basho/bitcask/hooks","issue_events_url":"https://api.github.com/repos/basho/bitcask/issues/events{/number}","events_url":"https://api.github.com/repos/basho/bitcask/events","assignees_url":"https://api.github.com/repos/basho/bitcask/assignees{/user}","branches_url":"https://api.github.com/repos/basho/bitcask/branches{/branch}","tags_url":"https://api.github.com/repos/basho/bitcask/tags","blobs_url":"https://api.github.com/repos/basho/bitcask/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/basho/bitcask/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/basho/bitcask/git/refs{/sha}","trees_url":"https://api.github.com/repos/basho/bitcask/git/trees{/sha}","statuses_url":"https://api.github.com/repos/basho/bitcask/statuses/{sha}","languages_url":"https://api.github.com/repos/basho/bitcask/languages","stargazers_url":"https://api.github.com/repos/basho/bitcask/stargazers","contributors_url":"https://api.github.com/repos/basho/bitcask/contributors","subscribers_url":"https://api.github.com/repos/basho/bitcask/subscribers","subscription_url":"https://api.github.com/repos/basho/bitcask/subscription","commits_url":"https://api.github.com/repos/basho/bitcask/commits{/sha}","git_commits_url":"https://api.github.com/repos/basho/bitcask/git/commits{/sha}","comments_url":"https://api.github.com/repos/basho/bitcask/comments{/number}","issue_comment_url":"https://api.github.com/repos/basho/bitcask/issues/comments{/number}","contents_url":"https://api.github.com/repos/basho/bitcask/contents/{+path}","compare_url":"https://api.github.com/repos/basho/bitcask/compare/{base}...{head}","merges_url":"https://api.github.com/repos/basho/bitcask/merges","archive_url":"https://api.github.com/repos/basho/bitcask/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/basho/bitcask/downloads","issues_url":"https://api.github.com/repos/basho/bitcask/issues{/number}","pulls_url":"https://api.github.com/repos/basho/bitcask/pulls{/number}","milestones_url":"https://api.github.com/repos/basho/bitcask/milestones{/number}","notifications_url":"https://api.github.com/repos/basho/bitcask/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/basho/bitcask/labels{/name}","releases_url":"https://api.github.com/repos/basho/bitcask/releases{/id}","created_at":"2010-04-27T18:57:08Z","updated_at":"2015-11-26T14:43:52Z","pushed_at":"2015-12-04T22:01:52Z","git_url":"git://github.com/basho/bitcask.git","ssh_url":"git@github.com:basho/bitcask.git","clone_url":"https://github.com/basho/bitcask.git","svn_url":"https://github.com/basho/bitcask","homepage":"","size":4136,"stargazers_count":375,"watchers_count":375,"language":"Erlang","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":72,"mirror_url":null,"open_issues_count":24,"forks":72,"open_issues":24,"watchers":375,"default_branch":"develop"}},"base":{"label":"basho:1.7","ref":"1.7","sha":"f5317be038b2e76a84152e74725c2717844b153c","user":{"login":"basho","id":176293,"avatar_url":"https://avatars.githubusercontent.com/u/176293?v=3","gravatar_id":"","url":"https://api.github.com/users/basho","html_url":"https://github.com/basho","followers_url":"https://api.github.com/users/basho/followers","following_url":"https://api.github.com/users/basho/following{/other_user}","gists_url":"https://api.github.com/users/basho/gists{/gist_id}","starred_url":"https://api.github.com/users/basho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/basho/subscriptions","organizations_url":"https://api.github.com/users/basho/orgs","repos_url":"https://api.github.com/users/basho/repos","events_url":"https://api.github.com/users/basho/events{/privacy}","received_events_url":"https://api.github.com/users/basho/received_events","type":"Organization","site_admin":false},"repo":{"id":632037,"name":"bitcask","full_name":"basho/bitcask","owner":{"login":"basho","id":176293,"avatar_url":"https://avatars.githubusercontent.com/u/176293?v=3","gravatar_id":"","url":"https://api.github.com/users/basho","html_url":"https://github.com/basho","followers_url":"https://api.github.com/users/basho/followers","following_url":"https://api.github.com/users/basho/following{/other_user}","gists_url":"https://api.github.com/users/basho/gists{/gist_id}","starred_url":"https://api.github.com/users/basho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/basho/subscriptions","organizations_url":"https://api.github.com/users/basho/orgs","repos_url":"https://api.github.com/users/basho/repos","events_url":"https://api.github.com/users/basho/events{/privacy}","received_events_url":"https://api.github.com/users/basho/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/basho/bitcask","description":"because you need another a key/value storage engine","fork":false,"url":"https://api.github.com/repos/basho/bitcask","forks_url":"https://api.github.com/repos/basho/bitcask/forks","keys_url":"https://api.github.com/repos/basho/bitcask/keys{/key_id}","collaborators_url":"https://api.github.com/repos/basho/bitcask/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/basho/bitcask/teams","hooks_url":"https://api.github.com/repos/basho/bitcask/hooks","issue_events_url":"https://api.github.com/repos/basho/bitcask/issues/events{/number}","events_url":"https://api.github.com/repos/basho/bitcask/events","assignees_url":"https://api.github.com/repos/basho/bitcask/assignees{/user}","branches_url":"https://api.github.com/repos/basho/bitcask/branches{/branch}","tags_url":"https://api.github.com/repos/basho/bitcask/tags","blobs_url":"https://api.github.com/repos/basho/bitcask/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/basho/bitcask/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/basho/bitcask/git/refs{/sha}","trees_url":"https://api.github.com/repos/basho/bitcask/git/trees{/sha}","statuses_url":"https://api.github.com/repos/basho/bitcask/statuses/{sha}","languages_url":"https://api.github.com/repos/basho/bitcask/languages","stargazers_url":"https://api.github.com/repos/basho/bitcask/stargazers","contributors_url":"https://api.github.com/repos/basho/bitcask/contributors","subscribers_url":"https://api.github.com/repos/basho/bitcask/subscribers","subscription_url":"https://api.github.com/repos/basho/bitcask/subscription","commits_url":"https://api.github.com/repos/basho/bitcask/commits{/sha}","git_commits_url":"https://api.github.com/repos/basho/bitcask/git/commits{/sha}","comments_url":"https://api.github.com/repos/basho/bitcask/comments{/number}","issue_comment_url":"https://api.github.com/repos/basho/bitcask/issues/comments{/number}","contents_url":"https://api.github.com/repos/basho/bitcask/contents/{+path}","compare_url":"https://api.github.com/repos/basho/bitcask/compare/{base}...{head}","merges_url":"https://api.github.com/repos/basho/bitcask/merges","archive_url":"https://api.github.com/repos/basho/bitcask/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/basho/bitcask/downloads","issues_url":"https://api.github.com/repos/basho/bitcask/issues{/number}","pulls_url":"https://api.github.com/repos/basho/bitcask/pulls{/number}","milestones_url":"https://api.github.com/repos/basho/bitcask/milestones{/number}","notifications_url":"https://api.github.com/repos/basho/bitcask/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/basho/bitcask/labels{/name}","releases_url":"https://api.github.com/repos/basho/bitcask/releases{/id}","created_at":"2010-04-27T18:57:08Z","updated_at":"2015-11-26T14:43:52Z","pushed_at":"2015-12-04T22:01:52Z","git_url":"git://github.com/basho/bitcask.git","ssh_url":"git@github.com:basho/bitcask.git","clone_url":"https://github.com/basho/bitcask.git","svn_url":"https://github.com/basho/bitcask","homepage":"","size":4136,"stargazers_count":375,"watchers_count":375,"language":"Erlang","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":72,"mirror_url":null,"open_issues_count":24,"forks":72,"open_issues":24,"watchers":375,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/basho/bitcask/pulls/227"},"html":{"href":"https://github.com/basho/bitcask/pull/227"},"issue":{"href":"https://api.github.com/repos/basho/bitcask/issues/227"},"comments":{"href":"https://api.github.com/repos/basho/bitcask/issues/227/comments"},"review_comments":{"href":"https://api.github.com/repos/basho/bitcask/pulls/227/comments"},"review_comment":{"href":"https://api.github.com/repos/basho/bitcask/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/basho/bitcask/pulls/227/commits"},"statuses":{"href":"https://api.github.com/repos/basho/bitcask/statuses/52bce9c0bad9317534862cd3cdba56ba6b511f29"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":7,"deletions":3,"changed_files":1}}