Current Behavior
org.gradle.internal.classloader.TransformingClassLoader is not thread-safe, because of TOCTOU:
|
@SuppressWarnings("deprecation") |
|
Package p = getPackage(packageName); |
|
if (p == null) { |
|
definePackage(packageName, null, null, null, null, null, null, null); |
|
} |
If two callsites find the package being absent, they both proceed to define, and the last one will get IllegalArgumentException.
Expected Behavior
TransformingClassLoader should be thread-safe, because it is registered as parallel capable.
Context (optional)
With parallel CC load, some less-used Gradle classes can be loaded concurrently.
Self-contained Reproducer Project
N/A, reported internally
Gradle version
8.14
Build scan URL (optional)
No response
Your Environment (optional)
No response
Current Behavior
org.gradle.internal.classloader.TransformingClassLoaderis not thread-safe, because of TOCTOU:gradle/platforms/core-runtime/classloaders/src/main/java/org/gradle/internal/classloader/TransformingClassLoader.java
Lines 79 to 83 in 6afc9ed
If two callsites find the package being absent, they both proceed to define, and the last one will get
IllegalArgumentException.Expected Behavior
TransformingClassLoadershould be thread-safe, because it is registered as parallel capable.Context (optional)
With parallel CC load, some less-used Gradle classes can be loaded concurrently.
Self-contained Reproducer Project
N/A, reported internally
Gradle version
8.14
Build scan URL (optional)
No response
Your Environment (optional)
No response