-
Notifications
You must be signed in to change notification settings - Fork 459
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
Exceptions when running clean & spotlessCheck during same build with buildcache #243
Comments
For what it's worth, I got reports of similar stack traces rooted at Removing We're using Java 8, Gradle 3.5.1 and version likely unrelated: users of update 91 of Java 8 see this far more often than users of update 222 of Java 8. |
Aha! Very helpful. We fixed the single-project/single-threaded version of this in #159, but we have a multi-project parallel-execution race condition. Whenever any project calls Here is one workaround: private static Object lastCacheKey;
public static void SpotlessCache.clearOnce(Object key) {
synchronized (SpotlessCache.class) {
if (key != lastCacheKey) {
SpotlessCache.clear();
lastCacheKey = key;
}
}
} The question is, what is a same-across-projects but unique-per-run value that we can pass here: spotless/plugin-gradle/src/main/java/com/diffplug/gradle/spotless/SpotlessPlugin.java Line 39 in 2ca2107
Maybe |
A fix has been published in |
Ah, this one back to haunt us again?? |
My testing shows that |
@nedtwigg , I was able to test Many thanks! |
Thanks for the |
@smoothreggae I had a similar problem using parallel builds for gradle version 3.5.1 Did the parallel build work for version 3.27.0? |
Running
./gradlew clean check
with the Gradle Build Cache enabled seems to produce theInvocationTargetException
again. May be a resurgence of #159.I know that Spotless doesn't have support with the Gradle Build Cache so this might just be because the
clean
andspotlessCheck
task are happening really fast due to the rest of the build being grabbed from the cache.If you are submitting a bug, please include the following:
Spotless Configuration Blocks:
There are actually a few exceptions in here that are different.
The text was updated successfully, but these errors were encountered: