{"action":"closed","number":77,"pull_request":{"url":"https://api.github.com/repos/frerich/clcache/pulls/77","id":70053634,"html_url":"https://github.com/frerich/clcache/pull/77","diff_url":"https://github.com/frerich/clcache/pull/77.diff","patch_url":"https://github.com/frerich/clcache/pull/77.patch","issue_url":"https://api.github.com/repos/frerich/clcache/issues/77","number":77,"state":"closed","locked":false,"title":"Fixed locking strategy to avoid corrupting cache stats","user":{"login":"frerich","id":533425,"avatar_url":"https://avatars.githubusercontent.com/u/533425?v=3","gravatar_id":"","url":"https://api.github.com/users/frerich","html_url":"https://github.com/frerich","followers_url":"https://api.github.com/users/frerich/followers","following_url":"https://api.github.com/users/frerich/following{/other_user}","gists_url":"https://api.github.com/users/frerich/gists{/gist_id}","starred_url":"https://api.github.com/users/frerich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frerich/subscriptions","organizations_url":"https://api.github.com/users/frerich/orgs","repos_url":"https://api.github.com/users/frerich/repos","events_url":"https://api.github.com/users/frerich/events{/privacy}","received_events_url":"https://api.github.com/users/frerich/received_events","type":"User","site_admin":false},"body":"Concurrent invocations of clcache.py would easily break the cache\r\nstatistics. The reason for this was that in some cases, a\r\nread/modify/write session on the statistics was not guarded by a single\r\nlock, so two clcache.py processes A and B which try to bump some value\r\n(e.g. number of cache entries)might have executed a sequence like\r\n\r\n  A read value 5\r\n  B read value 5\r\n  A write value 6\r\n  B write value 6\r\n\r\nFix this by rewriting the locking strategy. Locking is no longer done at\r\nthe lowest level (since such locks do not compose) but at the toplevel\r\nin all relevant areas:\r\n\r\n- When printing the cache statistics\r\n- When resetting the cache statistics\r\n- When changing the cache configuration\r\n\r\nFurthermore, when processing a compiler request, the lock is acquired at\r\nleast once in order to:\r\n\r\n- Check if the invocation can be cached at all\r\n- Check if there is a cache entry\r\n\r\nThen (without the lock being held!) the compiler is invoked. Finally,\r\ndepending on the invocation and the configuration settings, a\r\npost-processing function is invoked to update the bookkeeping. This\r\nfunction also takes care of holding the lock as needed.","created_at":"2016-05-13T20:29:30Z","updated_at":"2016-05-15T19:27:38Z","closed_at":"2016-05-15T19:27:38Z","merged_at":"2016-05-15T19:27:38Z","merge_commit_sha":"a34dc99760a66419615cdd84df70a675dfbd8ca2","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/frerich/clcache/pulls/77/commits","review_comments_url":"https://api.github.com/repos/frerich/clcache/pulls/77/comments","review_comment_url":"https://api.github.com/repos/frerich/clcache/pulls/comments{/number}","comments_url":"https://api.github.com/repos/frerich/clcache/issues/77/comments","statuses_url":"https://api.github.com/repos/frerich/clcache/statuses/0610278e6b9a88be5729af0b4b82bb42c563be55","head":{"label":"frerich:fix_locking","ref":"fix_locking","sha":"0610278e6b9a88be5729af0b4b82bb42c563be55","user":{"login":"frerich","id":533425,"avatar_url":"https://avatars.githubusercontent.com/u/533425?v=3","gravatar_id":"","url":"https://api.github.com/users/frerich","html_url":"https://github.com/frerich","followers_url":"https://api.github.com/users/frerich/followers","following_url":"https://api.github.com/users/frerich/following{/other_user}","gists_url":"https://api.github.com/users/frerich/gists{/gist_id}","starred_url":"https://api.github.com/users/frerich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frerich/subscriptions","organizations_url":"https://api.github.com/users/frerich/orgs","repos_url":"https://api.github.com/users/frerich/repos","events_url":"https://api.github.com/users/frerich/events{/privacy}","received_events_url":"https://api.github.com/users/frerich/received_events","type":"User","site_admin":false},"repo":{"id":1190383,"name":"clcache","full_name":"frerich/clcache","owner":{"login":"frerich","id":533425,"avatar_url":"https://avatars.githubusercontent.com/u/533425?v=3","gravatar_id":"","url":"https://api.github.com/users/frerich","html_url":"https://github.com/frerich","followers_url":"https://api.github.com/users/frerich/followers","following_url":"https://api.github.com/users/frerich/following{/other_user}","gists_url":"https://api.github.com/users/frerich/gists{/gist_id}","starred_url":"https://api.github.com/users/frerich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frerich/subscriptions","organizations_url":"https://api.github.com/users/frerich/orgs","repos_url":"https://api.github.com/users/frerich/repos","events_url":"https://api.github.com/users/frerich/events{/privacy}","received_events_url":"https://api.github.com/users/frerich/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/frerich/clcache","description":"A compiler cache for MSVC, much like ccache for gcc","fork":false,"url":"https://api.github.com/repos/frerich/clcache","forks_url":"https://api.github.com/repos/frerich/clcache/forks","keys_url":"https://api.github.com/repos/frerich/clcache/keys{/key_id}","collaborators_url":"https://api.github.com/repos/frerich/clcache/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/frerich/clcache/teams","hooks_url":"https://api.github.com/repos/frerich/clcache/hooks","issue_events_url":"https://api.github.com/repos/frerich/clcache/issues/events{/number}","events_url":"https://api.github.com/repos/frerich/clcache/events","assignees_url":"https://api.github.com/repos/frerich/clcache/assignees{/user}","branches_url":"https://api.github.com/repos/frerich/clcache/branches{/branch}","tags_url":"https://api.github.com/repos/frerich/clcache/tags","blobs_url":"https://api.github.com/repos/frerich/clcache/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/frerich/clcache/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/frerich/clcache/git/refs{/sha}","trees_url":"https://api.github.com/repos/frerich/clcache/git/trees{/sha}","statuses_url":"https://api.github.com/repos/frerich/clcache/statuses/{sha}","languages_url":"https://api.github.com/repos/frerich/clcache/languages","stargazers_url":"https://api.github.com/repos/frerich/clcache/stargazers","contributors_url":"https://api.github.com/repos/frerich/clcache/contributors","subscribers_url":"https://api.github.com/repos/frerich/clcache/subscribers","subscription_url":"https://api.github.com/repos/frerich/clcache/subscription","commits_url":"https://api.github.com/repos/frerich/clcache/commits{/sha}","git_commits_url":"https://api.github.com/repos/frerich/clcache/git/commits{/sha}","comments_url":"https://api.github.com/repos/frerich/clcache/comments{/number}","issue_comment_url":"https://api.github.com/repos/frerich/clcache/issues/comments{/number}","contents_url":"https://api.github.com/repos/frerich/clcache/contents/{+path}","compare_url":"https://api.github.com/repos/frerich/clcache/compare/{base}...{head}","merges_url":"https://api.github.com/repos/frerich/clcache/merges","archive_url":"https://api.github.com/repos/frerich/clcache/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/frerich/clcache/downloads","issues_url":"https://api.github.com/repos/frerich/clcache/issues{/number}","pulls_url":"https://api.github.com/repos/frerich/clcache/pulls{/number}","milestones_url":"https://api.github.com/repos/frerich/clcache/milestones{/number}","notifications_url":"https://api.github.com/repos/frerich/clcache/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/frerich/clcache/labels{/name}","releases_url":"https://api.github.com/repos/frerich/clcache/releases{/id}","deployments_url":"https://api.github.com/repos/frerich/clcache/deployments","created_at":"2010-12-22T15:14:53Z","updated_at":"2016-05-13T17:02:16Z","pushed_at":"2016-05-15T19:27:38Z","git_url":"git://github.com/frerich/clcache.git","ssh_url":"git@github.com:frerich/clcache.git","clone_url":"https://github.com/frerich/clcache.git","svn_url":"https://github.com/frerich/clcache","homepage":"","size":280,"stargazers_count":86,"watchers_count":86,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":27,"mirror_url":null,"open_issues_count":13,"forks":27,"open_issues":13,"watchers":86,"default_branch":"master"}},"base":{"label":"frerich:master","ref":"master","sha":"82103507be4183d41752dd758ded287a821b5480","user":{"login":"frerich","id":533425,"avatar_url":"https://avatars.githubusercontent.com/u/533425?v=3","gravatar_id":"","url":"https://api.github.com/users/frerich","html_url":"https://github.com/frerich","followers_url":"https://api.github.com/users/frerich/followers","following_url":"https://api.github.com/users/frerich/following{/other_user}","gists_url":"https://api.github.com/users/frerich/gists{/gist_id}","starred_url":"https://api.github.com/users/frerich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frerich/subscriptions","organizations_url":"https://api.github.com/users/frerich/orgs","repos_url":"https://api.github.com/users/frerich/repos","events_url":"https://api.github.com/users/frerich/events{/privacy}","received_events_url":"https://api.github.com/users/frerich/received_events","type":"User","site_admin":false},"repo":{"id":1190383,"name":"clcache","full_name":"frerich/clcache","owner":{"login":"frerich","id":533425,"avatar_url":"https://avatars.githubusercontent.com/u/533425?v=3","gravatar_id":"","url":"https://api.github.com/users/frerich","html_url":"https://github.com/frerich","followers_url":"https://api.github.com/users/frerich/followers","following_url":"https://api.github.com/users/frerich/following{/other_user}","gists_url":"https://api.github.com/users/frerich/gists{/gist_id}","starred_url":"https://api.github.com/users/frerich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frerich/subscriptions","organizations_url":"https://api.github.com/users/frerich/orgs","repos_url":"https://api.github.com/users/frerich/repos","events_url":"https://api.github.com/users/frerich/events{/privacy}","received_events_url":"https://api.github.com/users/frerich/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/frerich/clcache","description":"A compiler cache for MSVC, much like ccache for gcc","fork":false,"url":"https://api.github.com/repos/frerich/clcache","forks_url":"https://api.github.com/repos/frerich/clcache/forks","keys_url":"https://api.github.com/repos/frerich/clcache/keys{/key_id}","collaborators_url":"https://api.github.com/repos/frerich/clcache/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/frerich/clcache/teams","hooks_url":"https://api.github.com/repos/frerich/clcache/hooks","issue_events_url":"https://api.github.com/repos/frerich/clcache/issues/events{/number}","events_url":"https://api.github.com/repos/frerich/clcache/events","assignees_url":"https://api.github.com/repos/frerich/clcache/assignees{/user}","branches_url":"https://api.github.com/repos/frerich/clcache/branches{/branch}","tags_url":"https://api.github.com/repos/frerich/clcache/tags","blobs_url":"https://api.github.com/repos/frerich/clcache/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/frerich/clcache/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/frerich/clcache/git/refs{/sha}","trees_url":"https://api.github.com/repos/frerich/clcache/git/trees{/sha}","statuses_url":"https://api.github.com/repos/frerich/clcache/statuses/{sha}","languages_url":"https://api.github.com/repos/frerich/clcache/languages","stargazers_url":"https://api.github.com/repos/frerich/clcache/stargazers","contributors_url":"https://api.github.com/repos/frerich/clcache/contributors","subscribers_url":"https://api.github.com/repos/frerich/clcache/subscribers","subscription_url":"https://api.github.com/repos/frerich/clcache/subscription","commits_url":"https://api.github.com/repos/frerich/clcache/commits{/sha}","git_commits_url":"https://api.github.com/repos/frerich/clcache/git/commits{/sha}","comments_url":"https://api.github.com/repos/frerich/clcache/comments{/number}","issue_comment_url":"https://api.github.com/repos/frerich/clcache/issues/comments{/number}","contents_url":"https://api.github.com/repos/frerich/clcache/contents/{+path}","compare_url":"https://api.github.com/repos/frerich/clcache/compare/{base}...{head}","merges_url":"https://api.github.com/repos/frerich/clcache/merges","archive_url":"https://api.github.com/repos/frerich/clcache/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/frerich/clcache/downloads","issues_url":"https://api.github.com/repos/frerich/clcache/issues{/number}","pulls_url":"https://api.github.com/repos/frerich/clcache/pulls{/number}","milestones_url":"https://api.github.com/repos/frerich/clcache/milestones{/number}","notifications_url":"https://api.github.com/repos/frerich/clcache/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/frerich/clcache/labels{/name}","releases_url":"https://api.github.com/repos/frerich/clcache/releases{/id}","deployments_url":"https://api.github.com/repos/frerich/clcache/deployments","created_at":"2010-12-22T15:14:53Z","updated_at":"2016-05-13T17:02:16Z","pushed_at":"2016-05-15T19:27:38Z","git_url":"git://github.com/frerich/clcache.git","ssh_url":"git@github.com:frerich/clcache.git","clone_url":"https://github.com/frerich/clcache.git","svn_url":"https://github.com/frerich/clcache","homepage":"","size":280,"stargazers_count":86,"watchers_count":86,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":27,"mirror_url":null,"open_issues_count":13,"forks":27,"open_issues":13,"watchers":86,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/frerich/clcache/pulls/77"},"html":{"href":"https://github.com/frerich/clcache/pull/77"},"issue":{"href":"https://api.github.com/repos/frerich/clcache/issues/77"},"comments":{"href":"https://api.github.com/repos/frerich/clcache/issues/77/comments"},"review_comments":{"href":"https://api.github.com/repos/frerich/clcache/pulls/77/comments"},"review_comment":{"href":"https://api.github.com/repos/frerich/clcache/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/frerich/clcache/pulls/77/commits"},"statuses":{"href":"https://api.github.com/repos/frerich/clcache/statuses/0610278e6b9a88be5729af0b4b82bb42c563be55"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"frerich","id":533425,"avatar_url":"https://avatars.githubusercontent.com/u/533425?v=3","gravatar_id":"","url":"https://api.github.com/users/frerich","html_url":"https://github.com/frerich","followers_url":"https://api.github.com/users/frerich/followers","following_url":"https://api.github.com/users/frerich/following{/other_user}","gists_url":"https://api.github.com/users/frerich/gists{/gist_id}","starred_url":"https://api.github.com/users/frerich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frerich/subscriptions","organizations_url":"https://api.github.com/users/frerich/orgs","repos_url":"https://api.github.com/users/frerich/repos","events_url":"https://api.github.com/users/frerich/events{/privacy}","received_events_url":"https://api.github.com/users/frerich/received_events","type":"User","site_admin":false},"comments":8,"review_comments":0,"commits":1,"additions":183,"deletions":182,"changed_files":3}}