Long Build time on server after Gradle Upgrade to 6.9.2 from 5.2.1

Hello,
we are facing performance problems since we have upgraded our gradle version from 5.2.1 to 6.9.2.
We followed strictly the migration guide and all other services(14) don’t face this problem.
Although the config seems to be the same.
The task creation looks like this:

Task Duration Result
: 17m27.08s (total)
:compileJava 16m49.67s
:test 25.469s
:compileTestJava 8.612s
:jacocoTestReport 3.284s
:processResources 0.033s
:processTestResources 0.012s
:classes 0s Did No Work
:testClasses 0s Did No Work

Before compileJava Task took 2.5 mins.
What I can observe when I enable --debug is a lot of logs like this:
2022-07-21T11:29:12.312+0000 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
2022-07-21T11:29:12.312+0000 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2022-07-21T11:29:12.312+0000 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.


2022-07-21T11:45:42.312+0000 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
2022-07-21T11:45:42.312+0000 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2022-07-21T11:45:42.312+0000 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.

This action takes 16mins and I don’t know why this happens.

Any idea what could cause the issue?
This is how we execute it:
./gradlew --stacktrace --parallel -DXmx=4096M -DXms=4096M --build-cache --profile --configuration-cache --configure-on-demand --daemon test

AND important note: This happens only on the server. Not on any local machine…

I hope you can support us in solving this problem.

Thank you in advance.
BR Alwin

Note:
I have upgraded now to latest gradle version 7.5.
The issue occurs now also on my local machone but differntly.
While it hangs on server on at the java compile task, on my local it hangs straight before executing the tests.
Which means has already compiled and the executed tests are shown as 0. Looping all the time because of some lock issue.

The plugins we are using:
id ‘com.github.johnrengelman.shadow’ version ‘7.1.2’
id ‘java’
id ‘maven-publish’
id ‘org.sonarqube’ version ‘3.2.0’
id ‘application’

I have already outcommented sonarqube plugin, dependency and all related tasks, still the same…

Fixed the problem:
test.jvmArgs(‘-noverify’, ‘-Xdebug’, ‘-Xrunjdwp:transport=dt_socket,server=y,address=5006,suspend=y’)

This line caused the issue.
I commented it out and the build run perfectly :scream:

1 Like