{"action":"created","issue":{"url":"https://api.github.com/repos/gradle/gradle/issues/933","repository_url":"https://api.github.com/repos/gradle/gradle","labels_url":"https://api.github.com/repos/gradle/gradle/issues/933/labels{/name}","comments_url":"https://api.github.com/repos/gradle/gradle/issues/933/comments","events_url":"https://api.github.com/repos/gradle/gradle/issues/933/events","html_url":"https://github.com/gradle/gradle/issues/933","id":191993300,"number":933,"title":"Local cache corruption when using `GradleBuild` type task","user":{"login":"danielsun1106","id":9151616,"avatar_url":"https://avatars.githubusercontent.com/u/9151616?v=3","gravatar_id":"","url":"https://api.github.com/users/danielsun1106","html_url":"https://github.com/danielsun1106","followers_url":"https://api.github.com/users/danielsun1106/followers","following_url":"https://api.github.com/users/danielsun1106/following{/other_user}","gists_url":"https://api.github.com/users/danielsun1106/gists{/gist_id}","starred_url":"https://api.github.com/users/danielsun1106/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielsun1106/subscriptions","organizations_url":"https://api.github.com/users/danielsun1106/orgs","repos_url":"https://api.github.com/users/danielsun1106/repos","events_url":"https://api.github.com/users/danielsun1106/events{/privacy}","received_events_url":"https://api.github.com/users/danielsun1106/received_events","type":"User","site_admin":false},"labels":[{"id":460356597,"url":"https://api.github.com/repos/gradle/gradle/labels/a:bug","name":"a:bug","color":"d93f0b","default":false},{"id":457176889,"url":"https://api.github.com/repos/gradle/gradle/labels/affects-version:3.2","name":"affects-version:3.2","color":"c5def5","default":false},{"id":478384995,"url":"https://api.github.com/repos/gradle/gradle/labels/from:contributor","name":"from:contributor","color":"0052cc","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2016-11-28T12:25:34Z","updated_at":"2016-12-04T05:13:08Z","closed_at":null,"body":"<!--- Provide a brief summary of the issue in the title above -->\r\n\r\n### Expected Behavior\r\n\"gradlew -PuseAntlr4=true clean installGroovy\" succeed to execute\r\n\r\n### Current Behavior\r\n\"gradlew -PuseAntlr4=true clean installGroovy\" fails sometimes\r\n\r\n### Context\r\n**workaround:** delete all files under '.gradle\\3.2.1\\taskArtifacts' and run \"gradlew -PuseAntlr4=true clean installGroovy\" again.\r\n\r\n### Steps to Reproduce (for bugs)\r\n1) git clone the parrot branch of apache/groovy; \r\n2) gradlew -PuseAntlr4=true clean installGroovy;\r\nNote: installGroovy will succeed at the first time, **but fails at the second time**\r\n\r\n### Your Environment\r\ngradle 3.2.1\r\njava version \"1.8.0_102\"\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/gradle/gradle/issues/comments/264685002","html_url":"https://github.com/gradle/gradle/issues/933#issuecomment-264685002","issue_url":"https://api.github.com/repos/gradle/gradle/issues/933","id":264685002,"user":{"login":"big-guy","id":5387972,"avatar_url":"https://avatars.githubusercontent.com/u/5387972?v=3","gravatar_id":"","url":"https://api.github.com/users/big-guy","html_url":"https://github.com/big-guy","followers_url":"https://api.github.com/users/big-guy/followers","following_url":"https://api.github.com/users/big-guy/following{/other_user}","gists_url":"https://api.github.com/users/big-guy/gists{/gist_id}","starred_url":"https://api.github.com/users/big-guy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/big-guy/subscriptions","organizations_url":"https://api.github.com/users/big-guy/orgs","repos_url":"https://api.github.com/users/big-guy/repos","events_url":"https://api.github.com/users/big-guy/events{/privacy}","received_events_url":"https://api.github.com/users/big-guy/received_events","type":"User","site_admin":false},"created_at":"2016-12-04T05:13:08Z","updated_at":"2016-12-04T05:13:08Z","body":"So I created a minimal failing example as an integration test (see https://github.com/gradle/gradle/commit/97395f75346f4a4df7f97e74e927fa50d2814ded).  It only fails if you run with the forked executor (the embedded executor only works because of how we run Gradle in the test), but you can see the same broken behavior with the embedded executor.\r\n\r\nI think the problem is in `org.gradle.cache.internal.DefaultCacheAccess#newCache`.  What I see is the same `CacheAccess` is shared between all users of a given cache (expected), but `newCache` creates independent `MultiProcessSafePersistentIndexedCache` instances for the same `cacheName` (I think this is unexpected).  Since each `GradleBuild` has its own `DefaultTaskHistoryStore` that calls `newCache`, we get multiple `MultiProcessSafePersistentIndexedCache` and eventually `BTreePersistentIndexedCache`.  \r\n\r\nMaybe we could keep track of the `MultiProcessSafePersistentIndexedCache` by `cacheName` in a Map instead of the `caches` Set we have now? /cc @adammurdoch \r\n\r\nThis may be the source of random corruption problems related to dependency resolution and plugin portal resolution since the same sort of problem occurs there too."}}
{"actor":{"display_login":"big-guy"}}