Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Concurrent spotlessJava tasks with eclipse hanging on empty p2 repository

Open
#2,515 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
38/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
java
Domain
build-system

Research direction

Reproduce the hang by clearing ~/.m2/repository/dev/equo/p2-data/ and running concurrent spotlessJava tasks. Start with the LockFile and P2Client entries in the supplied stack trace, then trace the EquoBasedStepBuilder and P2Model calls; done means the concurrent tasks complete when the p2 repository is empty.

Written by the indexing model from the issue text.

Description

With spotless gradle plugin 7.0.4 we are seeing the spotlessJava tasks keeps hanging in our CI environments. further investigation showed this seems like a concurrency issue. jstack gives me this stacktrace with two entries (for each active spotless java task) similar to this:

"Execution worker Thread 6" #117 [1841467] prio=5 os_prio=0 cpu=2438.51ms elapsed=100.17s tid=0x00007fcc0400e4e0 nid=1841467 in Object.wait()  [0x00007fcc415e5000]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait0(java.base@21.0.6/Native Method)
	- waiting on <no object reference available>
	at java.lang.Object.wait(java.base@21.0.6/Object.java:366)
	at java.lang.Object.wait(java.base@21.0.6/Object.java:339)
	at dev.equo.solstice.p2.LockFile.<init>(LockFile.java:40)
	- locked <0x00000000d2a38d00> (a java.lang.Object)
	at dev.equo.solstice.p2.P2Client.<init>(P2Client.java:72)
	at dev.equo.solstice.p2.P2Model.queryRaw(P2Model.java:105)
	at dev.equo.solstice.p2.P2Model.query(P2Model.java:136)
	at com.diffplug.spotless.extra.EquoBasedStepBuilder.lambda$build$0(EquoBasedStepBuilder.java:128)
	at com.diffplug.spotless.extra.EquoBasedStepBuilder$$Lambda/0x00007fcd9932a9d0.get(Unknown Source)
	at com.diffplug.spotless.JarState$Promised.get(JarState.java:73)
	at com.diffplug.spotless.extra.EquoBasedStepBuilder$EquoStep.state(EquoBasedStepBuilder.java:193)
	at com.diffplug.spotless.extra.EquoBasedStepBuilder.lambda$build$cc29b8bc$1(EquoBasedStepBuilder.java:144)
	at com.diffplug.spotless.extra.EquoBasedStepBuilder$$Lambda/0x00007fcd9932c700.apply(Unknown Source)
	at com.diffplug.spotless.FormatterStepSerializationRoundtrip.stateSupplier(FormatterStepSerializationRoundtrip.java:57)
	at com.diffplug.spotless.FormatterStepSerializationRoundtrip$HackClone$$Lambda/0x00007fcd9972f3a8.get(Unknown Source)
	at com.diffplug.spotless.ThrowingEx.get(ThrowingEx.java:67)
	at com.diffplug.spotless.FormatterStepSerializationRoundtrip$HackClone.writeObject(FormatterStepSerializationRoundtrip.java:113)
	at java.lang.invoke.LambdaForm$DMH/0x00007fcd9813c000.invokeSpecial(java.base@21.0.6/LambdaForm$DMH)
	at java.lang.invoke.LambdaForm$MH/0x00007fcd98018c00.invoke(java.base@21.0.6/LambdaForm$MH)
	at java.lang.invoke.Invokers$Holder.invokeExact_MT(java.base@21.0.6/Invokers$Holder)
	at jdk.internal.reflect.DirectMethodHandleAccessor.invokeImpl(java.base@21.0.6/DirectMethodHandleAccessor.java:154)
	at jdk.internal.reflect.DirectMethodHandleAccessor.invoke(java.base@21.0.6/DirectMethodHandleAccessor.java:103)
	at java.lang.reflect.Method.invoke(java.base@21.0.6/Method.java:580)
	at java.io.ObjectStreamClass.invokeWriteObject(java.base@21.0.6/ObjectStreamClass.java:1072)
	at java.io.ObjectOutputStream.writeSerialData(java.base@21.0.6/ObjectOutputStream.java:1529)
	at java.io.ObjectOutputStream.writeOrdinaryObject(java.base@21.0.6/ObjectOutputStream.java:1451)
	at java.io.ObjectOutputStream.writeObject0(java.base@21.0.6/ObjectOutputStream.java:1194)
	at java.io.ObjectOutputStream.writeObject(java.base@21.0.6/ObjectOutputStream.java:358)
	at com.diffplug.spotless.ConfigurationCacheHackList.writeObject(ConfigurationCacheHackList.java:76)
	at java.lang.invoke.LambdaForm$DMH/0x00007fcd9813c000.invokeSpecial(java.base@21.0.6/LambdaForm$DMH)

this is reproducible when I cleanup the ~/.m2/repository/dev/equo/p2-data/ folder locally and run our build again.
In general we got biten by this dynamic p2 lookups and I would love to see the resolution of those artifacts would be wired into the gradle dependency resolution instead of being completely hidden deep down in the spotless logic. This currently blocks us from updating to newer spotless gradle plugin versions.

Dominant language
Java
Stars
5.7k
Forks
560
Avg merge
1d 13h
Merged PRs (30d)
43

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from diffplug/spotless

All issues in diffplug/spotless

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.