{"action":"created","comment":{"url":"https://api.github.com/repos/facebook/rocksdb/pulls/comments/169804907","pull_request_review_id":98392733,"id":169804907,"diff_hunk":"@@ -696,6 +696,9 @@ class DBImpl : public DB {\n   // The writer must be the leader in write_thread_ and holding mutex_\n   Status WriteRecoverableState();\n \n+  // Actual implementation of Close()\n+  virtual Status CloseImpl();","path":"db/db_impl.h","position":5,"original_position":5,"commit_id":"e9e74a41de4f00d47fa37f7a0a7577d2b908390f","original_commit_id":"e9e74a41de4f00d47fa37f7a0a7577d2b908390f","user":{"login":"siying","id":5334567,"avatar_url":"https://avatars3.githubusercontent.com/u/5334567?v=4","gravatar_id":"","url":"https://api.github.com/users/siying","html_url":"https://github.com/siying","followers_url":"https://api.github.com/users/siying/followers","following_url":"https://api.github.com/users/siying/following{/other_user}","gists_url":"https://api.github.com/users/siying/gists{/gist_id}","starred_url":"https://api.github.com/users/siying/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/siying/subscriptions","organizations_url":"https://api.github.com/users/siying/orgs","repos_url":"https://api.github.com/users/siying/repos","events_url":"https://api.github.com/users/siying/events{/privacy}","received_events_url":"https://api.github.com/users/siying/received_events","type":"User","site_admin":false},"body":"What's the purpose of having a virtual DBImpl::CloseImpl()? Do we expect someone to override DBImpl? DB is an interface and DBImpl is the implementation. I don't see why someone wants to override DBImpl (may be except in unit tests) and even if they do why do they need to change CloseImpl()?","created_at":"2018-02-21T22:55:14Z","updated_at":"2018-02-21T22:55:17Z","html_url":"https://github.com/facebook/rocksdb/pull/3528#discussion_r169804907","pull_request_url":"https://api.github.com/repos/facebook/rocksdb/pulls/3528","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/facebook/rocksdb/pulls/comments/169804907"},"html":{"href":"https://github.com/facebook/rocksdb/pull/3528#discussion_r169804907"},"pull_request":{"href":"https://api.github.com/repos/facebook/rocksdb/pulls/3528"}},"in_reply_to_id":169798537},"pull_request":{"url":"https://api.github.com/repos/facebook/rocksdb/pulls/3528","id":170594828,"html_url":"https://github.com/facebook/rocksdb/pull/3528","diff_url":"https://github.com/facebook/rocksdb/pull/3528.diff","patch_url":"https://github.com/facebook/rocksdb/pull/3528.patch","issue_url":"https://api.github.com/repos/facebook/rocksdb/issues/3528","number":3528,"state":"open","locked":false,"title":"Fix the Logger::Close() and DBImpl::Close() design pattern","user":{"login":"anand1976","id":33647610,"avatar_url":"https://avatars0.githubusercontent.com/u/33647610?v=4","gravatar_id":"","url":"https://api.github.com/users/anand1976","html_url":"https://github.com/anand1976","followers_url":"https://api.github.com/users/anand1976/followers","following_url":"https://api.github.com/users/anand1976/following{/other_user}","gists_url":"https://api.github.com/users/anand1976/gists{/gist_id}","starred_url":"https://api.github.com/users/anand1976/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anand1976/subscriptions","organizations_url":"https://api.github.com/users/anand1976/orgs","repos_url":"https://api.github.com/users/anand1976/repos","events_url":"https://api.github.com/users/anand1976/events{/privacy}","received_events_url":"https://api.github.com/users/anand1976/received_events","type":"User","site_admin":false},"body":"Summary:\r\nThe recent Logger::Close() and DBImpl::Close() implementation rely on\r\ncalling the CloseImpl() virtual function from the destructor, which will\r\nnot work. Refactor the implementation to have a private close helper\r\nfunction in derived classes that can be called by both CloseImpl() and\r\nthe destructor.\r\n\r\nTest Plan:\r\n1. New unit tests to explcitly check for proper close\r\n2. make check","created_at":"2018-02-21T21:35:17Z","updated_at":"2018-02-21T22:55:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d4b6c7f70cc12f07cde5aff7e3a06d661a71b490","assignee":null,"assignees":[],"requested_reviewers":[{"login":"gfosco","id":406732,"avatar_url":"https://avatars2.githubusercontent.com/u/406732?v=4","gravatar_id":"","url":"https://api.github.com/users/gfosco","html_url":"https://github.com/gfosco","followers_url":"https://api.github.com/users/gfosco/followers","following_url":"https://api.github.com/users/gfosco/following{/other_user}","gists_url":"https://api.github.com/users/gfosco/gists{/gist_id}","starred_url":"https://api.github.com/users/gfosco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gfosco/subscriptions","organizations_url":"https://api.github.com/users/gfosco/orgs","repos_url":"https://api.github.com/users/gfosco/repos","events_url":"https://api.github.com/users/gfosco/events{/privacy}","received_events_url":"https://api.github.com/users/gfosco/received_events","type":"User","site_admin":false},{"login":"ajkr","id":4780362,"avatar_url":"https://avatars0.githubusercontent.com/u/4780362?v=4","gravatar_id":"","url":"https://api.github.com/users/ajkr","html_url":"https://github.com/ajkr","followers_url":"https://api.github.com/users/ajkr/followers","following_url":"https://api.github.com/users/ajkr/following{/other_user}","gists_url":"https://api.github.com/users/ajkr/gists{/gist_id}","starred_url":"https://api.github.com/users/ajkr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ajkr/subscriptions","organizations_url":"https://api.github.com/users/ajkr/orgs","repos_url":"https://api.github.com/users/ajkr/repos","events_url":"https://api.github.com/users/ajkr/events{/privacy}","received_events_url":"https://api.github.com/users/ajkr/received_events","type":"User","site_admin":false},{"login":"siying","id":5334567,"avatar_url":"https://avatars3.githubusercontent.com/u/5334567?v=4","gravatar_id":"","url":"https://api.github.com/users/siying","html_url":"https://github.com/siying","followers_url":"https://api.github.com/users/siying/followers","following_url":"https://api.github.com/users/siying/following{/other_user}","gists_url":"https://api.github.com/users/siying/gists{/gist_id}","starred_url":"https://api.github.com/users/siying/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/siying/subscriptions","organizations_url":"https://api.github.com/users/siying/orgs","repos_url":"https://api.github.com/users/siying/repos","events_url":"https://api.github.com/users/siying/events{/privacy}","received_events_url":"https://api.github.com/users/siying/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":196859108,"url":"https://api.github.com/repos/facebook/rocksdb/labels/CLA%20Signed","name":"CLA Signed","color":"009900","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/facebook/rocksdb/pulls/3528/commits","review_comments_url":"https://api.github.com/repos/facebook/rocksdb/pulls/3528/comments","review_comment_url":"https://api.github.com/repos/facebook/rocksdb/pulls/comments{/number}","comments_url":"https://api.github.com/repos/facebook/rocksdb/issues/3528/comments","statuses_url":"https://api.github.com/repos/facebook/rocksdb/statuses/e9e74a41de4f00d47fa37f7a0a7577d2b908390f","head":{"label":"anand1976:db_close2","ref":"db_close2","sha":"e9e74a41de4f00d47fa37f7a0a7577d2b908390f","user":{"login":"anand1976","id":33647610,"avatar_url":"https://avatars0.githubusercontent.com/u/33647610?v=4","gravatar_id":"","url":"https://api.github.com/users/anand1976","html_url":"https://github.com/anand1976","followers_url":"https://api.github.com/users/anand1976/followers","following_url":"https://api.github.com/users/anand1976/following{/other_user}","gists_url":"https://api.github.com/users/anand1976/gists{/gist_id}","starred_url":"https://api.github.com/users/anand1976/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anand1976/subscriptions","organizations_url":"https://api.github.com/users/anand1976/orgs","repos_url":"https://api.github.com/users/anand1976/repos","events_url":"https://api.github.com/users/anand1976/events{/privacy}","received_events_url":"https://api.github.com/users/anand1976/received_events","type":"User","site_admin":false},"repo":{"id":111024355,"name":"rocksdb","full_name":"anand1976/rocksdb","owner":{"login":"anand1976","id":33647610,"avatar_url":"https://avatars0.githubusercontent.com/u/33647610?v=4","gravatar_id":"","url":"https://api.github.com/users/anand1976","html_url":"https://github.com/anand1976","followers_url":"https://api.github.com/users/anand1976/followers","following_url":"https://api.github.com/users/anand1976/following{/other_user}","gists_url":"https://api.github.com/users/anand1976/gists{/gist_id}","starred_url":"https://api.github.com/users/anand1976/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anand1976/subscriptions","organizations_url":"https://api.github.com/users/anand1976/orgs","repos_url":"https://api.github.com/users/anand1976/repos","events_url":"https://api.github.com/users/anand1976/events{/privacy}","received_events_url":"https://api.github.com/users/anand1976/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/anand1976/rocksdb","description":"A library that provides an embeddable, persistent key-value store for fast storage.","fork":true,"url":"https://api.github.com/repos/anand1976/rocksdb","forks_url":"https://api.github.com/repos/anand1976/rocksdb/forks","keys_url":"https://api.github.com/repos/anand1976/rocksdb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/anand1976/rocksdb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/anand1976/rocksdb/teams","hooks_url":"https://api.github.com/repos/anand1976/rocksdb/hooks","issue_events_url":"https://api.github.com/repos/anand1976/rocksdb/issues/events{/number}","events_url":"https://api.github.com/repos/anand1976/rocksdb/events","assignees_url":"https://api.github.com/repos/anand1976/rocksdb/assignees{/user}","branches_url":"https://api.github.com/repos/anand1976/rocksdb/branches{/branch}","tags_url":"https://api.github.com/repos/anand1976/rocksdb/tags","blobs_url":"https://api.github.com/repos/anand1976/rocksdb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/anand1976/rocksdb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/anand1976/rocksdb/git/refs{/sha}","trees_url":"https://api.github.com/repos/anand1976/rocksdb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/anand1976/rocksdb/statuses/{sha}","languages_url":"https://api.github.com/repos/anand1976/rocksdb/languages","stargazers_url":"https://api.github.com/repos/anand1976/rocksdb/stargazers","contributors_url":"https://api.github.com/repos/anand1976/rocksdb/contributors","subscribers_url":"https://api.github.com/repos/anand1976/rocksdb/subscribers","subscription_url":"https://api.github.com/repos/anand1976/rocksdb/subscription","commits_url":"https://api.github.com/repos/anand1976/rocksdb/commits{/sha}","git_commits_url":"https://api.github.com/repos/anand1976/rocksdb/git/commits{/sha}","comments_url":"https://api.github.com/repos/anand1976/rocksdb/comments{/number}","issue_comment_url":"https://api.github.com/repos/anand1976/rocksdb/issues/comments{/number}","contents_url":"https://api.github.com/repos/anand1976/rocksdb/contents/{+path}","compare_url":"https://api.github.com/repos/anand1976/rocksdb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/anand1976/rocksdb/merges","archive_url":"https://api.github.com/repos/anand1976/rocksdb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/anand1976/rocksdb/downloads","issues_url":"https://api.github.com/repos/anand1976/rocksdb/issues{/number}","pulls_url":"https://api.github.com/repos/anand1976/rocksdb/pulls{/number}","milestones_url":"https://api.github.com/repos/anand1976/rocksdb/milestones{/number}","notifications_url":"https://api.github.com/repos/anand1976/rocksdb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/anand1976/rocksdb/labels{/name}","releases_url":"https://api.github.com/repos/anand1976/rocksdb/releases{/id}","deployments_url":"https://api.github.com/repos/anand1976/rocksdb/deployments","created_at":"2017-11-16T21:27:59Z","updated_at":"2017-11-16T21:28:05Z","pushed_at":"2018-02-21T19:45:52Z","git_url":"git://github.com/anand1976/rocksdb.git","ssh_url":"git@github.com:anand1976/rocksdb.git","clone_url":"https://github.com/anand1976/rocksdb.git","svn_url":"https://github.com/anand1976/rocksdb","homepage":"http://rocksdb.org","size":111520,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"facebook:master","ref":"master","sha":"8ada876dfe2356a9f078ce17aa51057eeb8f17b9","user":{"login":"facebook","id":69631,"avatar_url":"https://avatars3.githubusercontent.com/u/69631?v=4","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"repo":{"id":6934395,"name":"rocksdb","full_name":"facebook/rocksdb","owner":{"login":"facebook","id":69631,"avatar_url":"https://avatars3.githubusercontent.com/u/69631?v=4","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/facebook/rocksdb","description":"A library that provides an embeddable, persistent key-value store for fast storage.","fork":false,"url":"https://api.github.com/repos/facebook/rocksdb","forks_url":"https://api.github.com/repos/facebook/rocksdb/forks","keys_url":"https://api.github.com/repos/facebook/rocksdb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/facebook/rocksdb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/facebook/rocksdb/teams","hooks_url":"https://api.github.com/repos/facebook/rocksdb/hooks","issue_events_url":"https://api.github.com/repos/facebook/rocksdb/issues/events{/number}","events_url":"https://api.github.com/repos/facebook/rocksdb/events","assignees_url":"https://api.github.com/repos/facebook/rocksdb/assignees{/user}","branches_url":"https://api.github.com/repos/facebook/rocksdb/branches{/branch}","tags_url":"https://api.github.com/repos/facebook/rocksdb/tags","blobs_url":"https://api.github.com/repos/facebook/rocksdb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/facebook/rocksdb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/facebook/rocksdb/git/refs{/sha}","trees_url":"https://api.github.com/repos/facebook/rocksdb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/facebook/rocksdb/statuses/{sha}","languages_url":"https://api.github.com/repos/facebook/rocksdb/languages","stargazers_url":"https://api.github.com/repos/facebook/rocksdb/stargazers","contributors_url":"https://api.github.com/repos/facebook/rocksdb/contributors","subscribers_url":"https://api.github.com/repos/facebook/rocksdb/subscribers","subscription_url":"https://api.github.com/repos/facebook/rocksdb/subscription","commits_url":"https://api.github.com/repos/facebook/rocksdb/commits{/sha}","git_commits_url":"https://api.github.com/repos/facebook/rocksdb/git/commits{/sha}","comments_url":"https://api.github.com/repos/facebook/rocksdb/comments{/number}","issue_comment_url":"https://api.github.com/repos/facebook/rocksdb/issues/comments{/number}","contents_url":"https://api.github.com/repos/facebook/rocksdb/contents/{+path}","compare_url":"https://api.github.com/repos/facebook/rocksdb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/facebook/rocksdb/merges","archive_url":"https://api.github.com/repos/facebook/rocksdb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/facebook/rocksdb/downloads","issues_url":"https://api.github.com/repos/facebook/rocksdb/issues{/number}","pulls_url":"https://api.github.com/repos/facebook/rocksdb/pulls{/number}","milestones_url":"https://api.github.com/repos/facebook/rocksdb/milestones{/number}","notifications_url":"https://api.github.com/repos/facebook/rocksdb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/facebook/rocksdb/labels{/name}","releases_url":"https://api.github.com/repos/facebook/rocksdb/releases{/id}","deployments_url":"https://api.github.com/repos/facebook/rocksdb/deployments","created_at":"2012-11-30T06:16:18Z","updated_at":"2018-02-21T19:09:57Z","pushed_at":"2018-02-21T21:42:34Z","git_url":"git://github.com/facebook/rocksdb.git","ssh_url":"git@github.com:facebook/rocksdb.git","clone_url":"https://github.com/facebook/rocksdb.git","svn_url":"https://github.com/facebook/rocksdb","homepage":"http://rocksdb.org","size":111706,"stargazers_count":9798,"watchers_count":9798,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":2155,"mirror_url":null,"archived":false,"open_issues_count":139,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":2155,"open_issues":139,"watchers":9798,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/facebook/rocksdb/pulls/3528"},"html":{"href":"https://github.com/facebook/rocksdb/pull/3528"},"issue":{"href":"https://api.github.com/repos/facebook/rocksdb/issues/3528"},"comments":{"href":"https://api.github.com/repos/facebook/rocksdb/issues/3528/comments"},"review_comments":{"href":"https://api.github.com/repos/facebook/rocksdb/pulls/3528/comments"},"review_comment":{"href":"https://api.github.com/repos/facebook/rocksdb/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/facebook/rocksdb/pulls/3528/commits"},"statuses":{"href":"https://api.github.com/repos/facebook/rocksdb/statuses/e9e74a41de4f00d47fa37f7a0a7577d2b908390f"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"siying"}}