Skip to content
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

Deadlock in parallel model building with Android Studio Hedgehog Canary 8 #25416

Closed
bamboo opened this issue Jun 16, 2023 · 1 comment
Closed

Comments

@bamboo
Copy link
Member

bamboo commented Jun 16, 2023

Actual Behavior

The issue seems to happen when parallel sync is used and there are multiple requests for the variant dependencies model in a single Gradle subproject.
Typically, when Gradle sync runs, we use single variant sync and every Gradle subproject builds only a single instance of VariantDependencie model (the one doing the dependency resolution).
However, in the Project Structure Dialog (Project View -> select module -> right click -> Open Module Settings -> Select Dependencies), it seems like we hit a deadlock.

Expected Behavior

No deadlock in Project Structure Dialog (Project View -> select module -> right click -> Open Module Settings -> Select Dependencies).

@bamboo
Copy link
Member Author

bamboo commented Jun 20, 2023

The first bad commit is 70416ae

sschuberth referenced this issue Jun 21, 2023
…iven a variant selected during graph resolution.

Use this in a few places instead of parameters, and also create fewer copies of the set of available variants when variant reselection is enabled.
bot-gradle added a commit that referenced this issue Jun 22, 2023
…ments

This PR effectively reverts the following PRs:
* #25105
* #24906
* #24828

The last one seems to be the root cause for #25416 and the other 2 are built on top of it.

This is not a confirmation that the revert needs to happen but a test to see if it is possible and passes CI.

Co-authored-by: Louis Jacomet <louis@gradle.com>
@ljacomet ljacomet modified the milestones: 8.2 RC3, 8.3 RC1 Jun 27, 2023
bot-gradle added a commit that referenced this issue Jul 4, 2023
…ation

Deliberately avoid locking the initialization of `artifactResolveState`.

This object may be shared across multiple worker threads, and the computation of `legacyVariants` is likely to require acquiring the state lock for the project that owns its `Configuration` leading to a potential deadlock situation.

For instance, a thread could acquire the `artifactResolveState` lock while another thread, which already owns the project lock, attempts to acquire the `artifactResolveState` lock.

See #25416

Co-authored-by: Rodrigo B. de Oliveira <rodrigo@gradle.com>
@bamboo bamboo closed this as completed Jul 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants