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

Fix deadlock when collecting metadata #391

Merged
merged 1 commit into from Jan 30, 2023
Merged

Fix deadlock when collecting metadata #391

merged 1 commit into from Jan 30, 2023

Conversation

melix
Copy link
Collaborator

@melix melix commented Jan 24, 2023

The reachability metadata service is not thread-safe, but it is possible for it to be called from multiple tasks in a multi-project. It this happens, then a deadlock may happen, or weird errors with a property not set can be thrown at the user.

This fixes the problem by making sure only a single task can access the service concurrently. Ideally, the service should be reworked to allow concurrent access, but it's quite some work since it involves locking access to the repository (typically to download and unzip metadata).

Fixes #387

The reachability metadata service is not thread-safe, but it is
possible for it to be called from multiple tasks in a multi-project.
It this happens, then a deadlock may happen, or weird errors with
a property not set can be thrown at the user.

This fixes the problem by making sure only a single task can
access the service concurrently. Ideally, the service should be
reworked to allow concurrent access, but it's quite some work
since it involves locking access to the repository (typically
to download and unzip metadata).

Fixes #387
@melix melix added bug Something isn't working gradle-plugin Related to Gradle plugin labels Jan 24, 2023
@melix melix added this to the 0.9.20 milestone Jan 24, 2023
@melix melix self-assigned this Jan 24, 2023
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Jan 24, 2023
@melix melix merged commit 7adaa46 into master Jan 30, 2023
@melix melix deleted the cc/issue-387 branch January 30, 2023 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working gradle-plugin Related to Gradle plugin OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Gradle collectReachabilityMetadata hangs indefinitely
2 participants