{"action":"created","comment":{"url":"https://api.github.com/repos/cvmfs/cvmfs/pulls/comments/22648627","id":22648627,"diff_hunk":"@@ -165,6 +165,12 @@ class History {\n    */\n   virtual bool GetHashes(std::vector<shash::Any> *hashes) const = 0;\n \n+  // database file management controls\n+  virtual void TakeDatabaseFileOwnership() {};","path":"cvmfs/history.h","position":5,"original_position":5,"commit_id":"11f8f85528dd4b43da682e7af0d1834ada0d7d1e","original_commit_id":"11f8f85528dd4b43da682e7af0d1834ada0d7d1e","user":{"login":"jblomer","id":1557360,"avatar_url":"https://avatars.githubusercontent.com/u/1557360?v=3","gravatar_id":"","url":"https://api.github.com/users/jblomer","html_url":"https://github.com/jblomer","followers_url":"https://api.github.com/users/jblomer/followers","following_url":"https://api.github.com/users/jblomer/following{/other_user}","gists_url":"https://api.github.com/users/jblomer/gists{/gist_id}","starred_url":"https://api.github.com/users/jblomer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jblomer/subscriptions","organizations_url":"https://api.github.com/users/jblomer/orgs","repos_url":"https://api.github.com/users/jblomer/repos","events_url":"https://api.github.com/users/jblomer/events{/privacy}","received_events_url":"https://api.github.com/users/jblomer/received_events","type":"User","site_admin":false},"body":"Wouldn't it be better to make them abstract?  Otherwise one might forget to implement them in a derived class.","created_at":"2015-01-08T12:20:41Z","updated_at":"2015-01-08T12:20:41Z","html_url":"https://github.com/cvmfs/cvmfs/pull/667#discussion_r22648627","pull_request_url":"https://api.github.com/repos/cvmfs/cvmfs/pulls/667","_links":{"self":{"href":"https://api.github.com/repos/cvmfs/cvmfs/pulls/comments/22648627"},"html":{"href":"https://github.com/cvmfs/cvmfs/pull/667#discussion_r22648627"},"pull_request":{"href":"https://api.github.com/repos/cvmfs/cvmfs/pulls/667"}}},"pull_request":{"url":"https://api.github.com/repos/cvmfs/cvmfs/pulls/667","id":26972065,"html_url":"https://github.com/cvmfs/cvmfs/pull/667","diff_url":"https://github.com/cvmfs/cvmfs/pull/667.diff","patch_url":"https://github.com/cvmfs/cvmfs/pull/667.patch","issue_url":"https://api.github.com/repos/cvmfs/cvmfs/issues/667","number":667,"state":"open","locked":false,"title":"FIX: ObjectFetcher<> Leaks Temporary Files","user":{"login":"reneme","id":1562139,"avatar_url":"https://avatars.githubusercontent.com/u/1562139?v=3","gravatar_id":"","url":"https://api.github.com/users/reneme","html_url":"https://github.com/reneme","followers_url":"https://api.github.com/users/reneme/followers","following_url":"https://api.github.com/users/reneme/following{/other_user}","gists_url":"https://api.github.com/users/reneme/gists{/gist_id}","starred_url":"https://api.github.com/users/reneme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reneme/subscriptions","organizations_url":"https://api.github.com/users/reneme/orgs","repos_url":"https://api.github.com/users/reneme/repos","events_url":"https://api.github.com/users/reneme/events{/privacy}","received_events_url":"https://api.github.com/users/reneme/received_events","type":"User","site_admin":false},"body":"This add an auto-manage functionality to the `Database<>` class that unlinks the underlying SQLite file when the database is destructed. By default, this  feature is disabled (legacy compatibility) but it exposes an API to control it:\r\n```C++\r\nvoid Database<>::TakeFileOwnership();\r\nvoid Database<>::DropFileOwnership();\r\nvoid Database<>::OwnsFile();\r\n```\r\n\r\nThe `ObjectFetcher<>` is hiding the file dependency of `Catalog` and `History` objects. Hence if returned by `ObjectFetcher<>` they have the auto-management enabled by default for convenience. If the using code of `ObjectFetcher<>` wishes to manage the database file manually, both `Catalog` and `History` expose a facade API for controlling the underlying database:\r\n```C++\r\nvoid History::TakeDatabaseFileOwnership();\r\nvoid History::DropDatabaseFileOwnership();\r\nvoid History::OwnsDatabaseFile();\r\n```\r\n\r\nFurthermore this contains a number of unit test cases to verify the proper functionality of the auto-management feature.","created_at":"2015-01-07T17:17:26Z","updated_at":"2015-01-08T12:20:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0ed12202c6298ede27efaf29e19cbbd57135d039","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/cvmfs/cvmfs/pulls/667/commits","review_comments_url":"https://api.github.com/repos/cvmfs/cvmfs/pulls/667/comments","review_comment_url":"https://api.github.com/repos/cvmfs/cvmfs/pulls/comments/{number}","comments_url":"https://api.github.com/repos/cvmfs/cvmfs/issues/667/comments","statuses_url":"https://api.github.com/repos/cvmfs/cvmfs/statuses/11f8f85528dd4b43da682e7af0d1834ada0d7d1e","head":{"label":"reneme:feature-rm_tmp_files","ref":"feature-rm_tmp_files","sha":"11f8f85528dd4b43da682e7af0d1834ada0d7d1e","user":{"login":"reneme","id":1562139,"avatar_url":"https://avatars.githubusercontent.com/u/1562139?v=3","gravatar_id":"","url":"https://api.github.com/users/reneme","html_url":"https://github.com/reneme","followers_url":"https://api.github.com/users/reneme/followers","following_url":"https://api.github.com/users/reneme/following{/other_user}","gists_url":"https://api.github.com/users/reneme/gists{/gist_id}","starred_url":"https://api.github.com/users/reneme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reneme/subscriptions","organizations_url":"https://api.github.com/users/reneme/orgs","repos_url":"https://api.github.com/users/reneme/repos","events_url":"https://api.github.com/users/reneme/events{/privacy}","received_events_url":"https://api.github.com/users/reneme/received_events","type":"User","site_admin":false},"repo":{"id":6594761,"name":"cvmfs","full_name":"reneme/cvmfs","owner":{"login":"reneme","id":1562139,"avatar_url":"https://avatars.githubusercontent.com/u/1562139?v=3","gravatar_id":"","url":"https://api.github.com/users/reneme","html_url":"https://github.com/reneme","followers_url":"https://api.github.com/users/reneme/followers","following_url":"https://api.github.com/users/reneme/following{/other_user}","gists_url":"https://api.github.com/users/reneme/gists{/gist_id}","starred_url":"https://api.github.com/users/reneme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reneme/subscriptions","organizations_url":"https://api.github.com/users/reneme/orgs","repos_url":"https://api.github.com/users/reneme/repos","events_url":"https://api.github.com/users/reneme/events{/privacy}","received_events_url":"https://api.github.com/users/reneme/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/reneme/cvmfs","description":"The CernVM File System","fork":true,"url":"https://api.github.com/repos/reneme/cvmfs","forks_url":"https://api.github.com/repos/reneme/cvmfs/forks","keys_url":"https://api.github.com/repos/reneme/cvmfs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/reneme/cvmfs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/reneme/cvmfs/teams","hooks_url":"https://api.github.com/repos/reneme/cvmfs/hooks","issue_events_url":"https://api.github.com/repos/reneme/cvmfs/issues/events{/number}","events_url":"https://api.github.com/repos/reneme/cvmfs/events","assignees_url":"https://api.github.com/repos/reneme/cvmfs/assignees{/user}","branches_url":"https://api.github.com/repos/reneme/cvmfs/branches{/branch}","tags_url":"https://api.github.com/repos/reneme/cvmfs/tags","blobs_url":"https://api.github.com/repos/reneme/cvmfs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/reneme/cvmfs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/reneme/cvmfs/git/refs{/sha}","trees_url":"https://api.github.com/repos/reneme/cvmfs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/reneme/cvmfs/statuses/{sha}","languages_url":"https://api.github.com/repos/reneme/cvmfs/languages","stargazers_url":"https://api.github.com/repos/reneme/cvmfs/stargazers","contributors_url":"https://api.github.com/repos/reneme/cvmfs/contributors","subscribers_url":"https://api.github.com/repos/reneme/cvmfs/subscribers","subscription_url":"https://api.github.com/repos/reneme/cvmfs/subscription","commits_url":"https://api.github.com/repos/reneme/cvmfs/commits{/sha}","git_commits_url":"https://api.github.com/repos/reneme/cvmfs/git/commits{/sha}","comments_url":"https://api.github.com/repos/reneme/cvmfs/comments{/number}","issue_comment_url":"https://api.github.com/repos/reneme/cvmfs/issues/comments/{number}","contents_url":"https://api.github.com/repos/reneme/cvmfs/contents/{+path}","compare_url":"https://api.github.com/repos/reneme/cvmfs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/reneme/cvmfs/merges","archive_url":"https://api.github.com/repos/reneme/cvmfs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/reneme/cvmfs/downloads","issues_url":"https://api.github.com/repos/reneme/cvmfs/issues{/number}","pulls_url":"https://api.github.com/repos/reneme/cvmfs/pulls{/number}","milestones_url":"https://api.github.com/repos/reneme/cvmfs/milestones{/number}","notifications_url":"https://api.github.com/repos/reneme/cvmfs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/reneme/cvmfs/labels{/name}","releases_url":"https://api.github.com/repos/reneme/cvmfs/releases{/id}","created_at":"2012-11-08T10:30:55Z","updated_at":"2015-01-07T12:27:28Z","pushed_at":"2015-01-08T08:59:51Z","git_url":"git://github.com/reneme/cvmfs.git","ssh_url":"git@github.com:reneme/cvmfs.git","clone_url":"https://github.com/reneme/cvmfs.git","svn_url":"https://github.com/reneme/cvmfs","homepage":"http://cernvm.cern.ch/portal/filesystem","size":88486,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":0,"default_branch":"devel"}},"base":{"label":"cvmfs:devel","ref":"devel","sha":"2132211233a0ea0b2aa91e65469e6620f9ea8072","user":{"login":"cvmfs","id":1560859,"avatar_url":"https://avatars.githubusercontent.com/u/1560859?v=3","gravatar_id":"","url":"https://api.github.com/users/cvmfs","html_url":"https://github.com/cvmfs","followers_url":"https://api.github.com/users/cvmfs/followers","following_url":"https://api.github.com/users/cvmfs/following{/other_user}","gists_url":"https://api.github.com/users/cvmfs/gists{/gist_id}","starred_url":"https://api.github.com/users/cvmfs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cvmfs/subscriptions","organizations_url":"https://api.github.com/users/cvmfs/orgs","repos_url":"https://api.github.com/users/cvmfs/repos","events_url":"https://api.github.com/users/cvmfs/events{/privacy}","received_events_url":"https://api.github.com/users/cvmfs/received_events","type":"Organization","site_admin":false},"repo":{"id":3784908,"name":"cvmfs","full_name":"cvmfs/cvmfs","owner":{"login":"cvmfs","id":1560859,"avatar_url":"https://avatars.githubusercontent.com/u/1560859?v=3","gravatar_id":"","url":"https://api.github.com/users/cvmfs","html_url":"https://github.com/cvmfs","followers_url":"https://api.github.com/users/cvmfs/followers","following_url":"https://api.github.com/users/cvmfs/following{/other_user}","gists_url":"https://api.github.com/users/cvmfs/gists{/gist_id}","starred_url":"https://api.github.com/users/cvmfs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cvmfs/subscriptions","organizations_url":"https://api.github.com/users/cvmfs/orgs","repos_url":"https://api.github.com/users/cvmfs/repos","events_url":"https://api.github.com/users/cvmfs/events{/privacy}","received_events_url":"https://api.github.com/users/cvmfs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cvmfs/cvmfs","description":"The CernVM File System","fork":false,"url":"https://api.github.com/repos/cvmfs/cvmfs","forks_url":"https://api.github.com/repos/cvmfs/cvmfs/forks","keys_url":"https://api.github.com/repos/cvmfs/cvmfs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cvmfs/cvmfs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cvmfs/cvmfs/teams","hooks_url":"https://api.github.com/repos/cvmfs/cvmfs/hooks","issue_events_url":"https://api.github.com/repos/cvmfs/cvmfs/issues/events{/number}","events_url":"https://api.github.com/repos/cvmfs/cvmfs/events","assignees_url":"https://api.github.com/repos/cvmfs/cvmfs/assignees{/user}","branches_url":"https://api.github.com/repos/cvmfs/cvmfs/branches{/branch}","tags_url":"https://api.github.com/repos/cvmfs/cvmfs/tags","blobs_url":"https://api.github.com/repos/cvmfs/cvmfs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cvmfs/cvmfs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cvmfs/cvmfs/git/refs{/sha}","trees_url":"https://api.github.com/repos/cvmfs/cvmfs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cvmfs/cvmfs/statuses/{sha}","languages_url":"https://api.github.com/repos/cvmfs/cvmfs/languages","stargazers_url":"https://api.github.com/repos/cvmfs/cvmfs/stargazers","contributors_url":"https://api.github.com/repos/cvmfs/cvmfs/contributors","subscribers_url":"https://api.github.com/repos/cvmfs/cvmfs/subscribers","subscription_url":"https://api.github.com/repos/cvmfs/cvmfs/subscription","commits_url":"https://api.github.com/repos/cvmfs/cvmfs/commits{/sha}","git_commits_url":"https://api.github.com/repos/cvmfs/cvmfs/git/commits{/sha}","comments_url":"https://api.github.com/repos/cvmfs/cvmfs/comments{/number}","issue_comment_url":"https://api.github.com/repos/cvmfs/cvmfs/issues/comments/{number}","contents_url":"https://api.github.com/repos/cvmfs/cvmfs/contents/{+path}","compare_url":"https://api.github.com/repos/cvmfs/cvmfs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cvmfs/cvmfs/merges","archive_url":"https://api.github.com/repos/cvmfs/cvmfs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cvmfs/cvmfs/downloads","issues_url":"https://api.github.com/repos/cvmfs/cvmfs/issues{/number}","pulls_url":"https://api.github.com/repos/cvmfs/cvmfs/pulls{/number}","milestones_url":"https://api.github.com/repos/cvmfs/cvmfs/milestones{/number}","notifications_url":"https://api.github.com/repos/cvmfs/cvmfs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cvmfs/cvmfs/labels{/name}","releases_url":"https://api.github.com/repos/cvmfs/cvmfs/releases{/id}","created_at":"2012-03-21T09:10:41Z","updated_at":"2015-01-08T10:51:23Z","pushed_at":"2015-01-08T10:51:23Z","git_url":"git://github.com/cvmfs/cvmfs.git","ssh_url":"git@github.com:cvmfs/cvmfs.git","clone_url":"https://github.com/cvmfs/cvmfs.git","svn_url":"https://github.com/cvmfs/cvmfs","homepage":"http://cernvm.cern.ch/portal/filesystem","size":92411,"stargazers_count":28,"watchers_count":28,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":24,"mirror_url":null,"open_issues_count":7,"forks":24,"open_issues":7,"watchers":28,"default_branch":"devel"}},"_links":{"self":{"href":"https://api.github.com/repos/cvmfs/cvmfs/pulls/667"},"html":{"href":"https://github.com/cvmfs/cvmfs/pull/667"},"issue":{"href":"https://api.github.com/repos/cvmfs/cvmfs/issues/667"},"comments":{"href":"https://api.github.com/repos/cvmfs/cvmfs/issues/667/comments"},"review_comments":{"href":"https://api.github.com/repos/cvmfs/cvmfs/pulls/667/comments"},"review_comment":{"href":"https://api.github.com/repos/cvmfs/cvmfs/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/cvmfs/cvmfs/pulls/667/commits"},"statuses":{"href":"https://api.github.com/repos/cvmfs/cvmfs/statuses/11f8f85528dd4b43da682e7af0d1834ada0d7d1e"}}}}