New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cleanup realization of pending provider #6614
Cleanup realization of pending provider #6614
Conversation
584ba2b
to
73247a5
Compare
It's not clear why we would make this change. What's the use case? The description says "a provider tries to add to the store while the store is busy realizing the provider" but doesn't specify whether this is a user specified provider added using I think a functional test that shows the use case would be useful. |
The issue surface when we want to generalize the domain object collection tests. First, we are hitting the issue fixed by #6617. Then, only certain container are hitting the failure as the underlying store behave differently between collection. The store What is happening is we are adding a new The simplest solution I found, instead of reversing the ownership like I was working previously, is to complete the adding ( I don't believe it's exactly a use case by just the internal implementation not allowing all collection to behave the same. I can't add a test to the store to show this issue as we aren't changing the store implementation, they are correctly implemented. We are changing the way we use the store from within the collection. The way we are using it just happens to make everything behave the same throughout the collections. I hope this explains it a bit better. |
73247a5
to
b872f4a
Compare
It allow `NamedDomainObjectCollection#named` to work properly.
It avoid concurent modification exception where a provider tries to add to the store while the store is busy realizing the provider.
b872f4a
to
9172642
Compare
d968f1e
to
9fe5b8c
Compare
It avoids concurrent modification exception where a provider tries to add
to the store while the store is busy realizing the provider. To work around this, we use the
doAddRealized
internal method.The PR also clean up the realization of a provider by introducing the
realizePending(ProviderInternal)
method to the store. The domain object collections now use this method instead of relying on the side effect ofProvider#get()
.Context
See gradle/gradle-native#709
Gradle Core Team Checklist