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

Consider disabling parallel configuration cache loading in dependency submission plugin #544

Open
cloudshiftchris opened this issue Jan 30, 2025 · 2 comments

Comments

@cloudshiftchris
Copy link

cloudshiftchris commented Jan 30, 2025

Ran into an issue when using the dependency submission plugin - we switched from GH ubuntu-latest standard runners (2 CPU) to a large runner (ubuntu-latest, 8 CPU); Gradle, as part of dependency submission, would either hang or error out with CC issues:

1: Task failed with an exception.
-----------
* What went wrong:
Error while saving task graph
> Configuration cache state could not be cached: field `value` of `org.gradle.internal.Try$Success` bean found in field `result` of `org.gradle.internal.serialization.Cached$Fixed` bean found in field `configurationResolvers` of task `:common:ForceDependencyResolutionPlugin_resolveProjectDependencies` of type `org.gradle.forceresolve.ResolveProjectDependenciesTask`: error writing value of type 'java.util.ArrayList'
   > Something has been appended to this collector already

Seems like a race condition in Gradle itself (8.12.1) or the ForceDependencyResolutionPlugin_resolveProjectDependencies tasks (wherever that lives), tickled by what dependency submission does.

Worked around this by adding action argument to disable parallel configuration cache (this is enabled by default in a custom Gradle distribution):

      uses: "gradle/actions/dependency-submission@0bdd871935719febd78681f197cd39af5b6e16a6" # v4.2.2
      with:
         ...
        additional-arguments: -Dorg.gradle.configuration-cache.parallel=false

Perhaps that option should be forced to false for dependency submission as the parallel configuration cache is an incubating feature with some caveats:

This is an incubating feature and may expose concurrency issues in some builds.

e.g. adding it to the set of options that are currently provided when running Gradle:

/home/runner/work/clario-saas-app/clario-saas-app/gradlew -Dorg.gradle.configureondemand=false -Dorg.gradle.dependency.verification=off -Dorg.gradle.unsafe.isolated-projects=false -Dorg.gradle.configuration-cache.parallel=false :ForceDependencyResolutionPlugin_resolveAllDependencies

(while this fails for dependency submission with parallel CC, the main build succeeds with parallel CC so we don't want to globally disable it)

@cloudshiftchris
Copy link
Author

Seems like this is the underlying issue: gradle/gradle#32158

@cloudshiftchris
Copy link
Author

cloudshiftchris commented Jan 30, 2025

Perhaps, if the Gradle version is known, -Dorg.gradle.configuration-cache.parallel=false could be selectively added such that for some future Gradle version (where parallel CC cache is no longer incubating) forcing it to false can be removed (yet the same dependency submission plugin would add the arg for older Gradle versions).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant