Stuck in lock acquire, wait, release loop in gradle 3.1


#1

In trying to improve performance, I noticed (by adding the --debug flag) that my build spends an unhealthy amount of time in a loop where the daemon is waiting to acquire the shared lock, acquires it, then releases it. This adds minutes to the build and takes a widly varying amount of time. Sometimes I can build in under two minutes, and others up to 16 minutes! If you have any suggestions about what is causing this, or need more information, please let me know.

My entire gradle.properties is

BOM_VERSION=Camden.RELEASE
CLOUD_DEPENDENCIES_VERSION=1.0.1.RELEASE
SPRING_BOOT_VERSION=1.4.1.RELEASE

org.gradle.configureondemand=true
org.gradle.parallel=true
org.gradle.workers.max=6
org.gradle.jvmargs=-Xmx7044m -Xms3072m -XX:MaxPermSize=3072m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8

The part of the debug output that shows this loop:

09:31:07.715 [DEBUG] [org.gradle.launcher.daemon.server.Daemon] DaemonExpirationPeriodicCheck running
09:31:07.717 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
09:31:07.718 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired.
09:31:07.719 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
09:31:07.721 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
09:31:07.722 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired.
09:31:07.722 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
09:31:17.715 [DEBUG] [org.gradle.launcher.daemon.server.Daemon] DaemonExpirationPeriodicCheck running
09:31:17.717 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
09:31:17.718 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired.
09:31:17.719 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
09:31:17.721 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
09:31:17.722 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired.
09:31:17.722 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
09:31:27.715 [DEBUG] [org.gradle.launcher.daemon.server.Daemon] DaemonExpirationPeriodicCheck running

Gradle Version: 3.1
Operating System and JVM version: Linux BLK-LIN-3D 4.4.0-38-generic #57-Ubuntu, openjdk version "1.8.0_91"
Is this a regression? If yes, which version of Gradle do you know it last worked for? Unknown


(Benjamin Muschko) #2

Hi,

Thanks for reporting this behavior. Is this something you started to see with 3.1 or did you experience the issue before that version as well?

Thanks,

Ben


#3

I haven’t experienced this behavior in previous versions.