Skip to content
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

Gradle use locks extensively when native agent is used #655

Closed
kgonia opened this issue Dec 12, 2024 · 10 comments
Closed

Gradle use locks extensively when native agent is used #655

kgonia opened this issue Dec 12, 2024 · 10 comments
Assignees
Labels
bug Something isn't working

Comments

@kgonia
Copy link

kgonia commented Dec 12, 2024

Hi, I also reported this on gradle - gradle/gradle#31668 but I was suggested to create issues also here as source of this is unknown and might be gradle issue or native plugin.

Describe the bug

When I run tests with -Pagent option gradle use far more locks than without it. As result tests are running much longer (minutes vs hours)

with my projects it's 68 vs 1097

To Reproduce

I've created simple project but it didn't fully show the problem as it has small test base. However with this project agent lock is acquired 1 time, with agent 3 times

https://github.com/[kgonia/gradle-native-locks-demo](https://github.com/kgonia/gradle-native-locks-demo

Expected behavior

Collecting reachability data during tests should execute in similar time as without it.

Logs

2024-12-12T14:14:05.840+0100 [LIFECYCLE] [class org.gradle.internal.buildevents.TaskExecutionLogger] > Task :policy-enforcer-api:test
2024-12-12T14:14:24.790+0100 [DEBUG] [TestEventLogger]     2024-12-12T14:14:24.789+01:00  INFO 10412 --- [    Test worker] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode
2024-12-12T14:14:24.811+0100 [DEBUG] [TestEventLogger]     2024-12-12T14:14:24.811+01:00  INFO 10412 --- [    Test worker] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data MongoDB repositories in DEFAULT mode.
2024-12-12T14:14:24.933+0100 [LIFECYCLE] [org.gradle.cache.internal.DefaultFileLockManager] 
2024-12-12T14:14:24.933+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
2024-12-12T14:14:24.933+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2024-12-12T14:14:24.933+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2024-12-12T14:14:24.934+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
2024-12-12T14:14:24.934+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2024-12-12T14:14:24.934+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2024-12-12T14:14:24.839+0100 [LIFECYCLE] [class org.gradle.internal.buildevents.TaskExecutionLogger] 
2024-12-12T14:14:24.839+0100 [LIFECYCLE] [class org.gradle.internal.buildevents.TaskExecutionLogger] > Task :policy-enforcer-api:test
2024-12-12T14:14:24.996+0100 [DEBUG] [TestEventLogger]     2024-12-12T14:14:24.996+01:00  INFO 10412 --- [    Test worker] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 148 ms. Found 0 MongoDB repository interfaces.
2024-12-12T14:14:25.107+0100 [DEBUG] [TestEventLogger]     2024-12-12T14:14:25.107+01:00  INFO 10412 --- [    Test worker] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode
2024-12-12T14:14:25.115+0100 [DEBUG] [TestEventLogger]     2024-12-12T14:14:25.114+01:00  INFO 10412 --- [    Test worker] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data Redis repositories in DEFAULT mode. 
2024-12-12T14:14:25.228+0100 [DEBUG] [TestEventLogger]     2024-12-12T14:14:25.227+01:00  INFO 10412 --- [    Test worker] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 59 ms. Found 0 Redis repository interfaces.
2024-12-12T14:14:33.552+0100 [LIFECYCLE] [org.gradle.internal.resources.AbstractTrackedResourceLock] 
2024-12-12T14:14:33.552+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Daemon worker: acquired lock on worker lease
2024-12-12T14:14:33.552+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Daemon worker: released lock on worker lease
2024-12-12T14:14:33.552+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 9: acquired lock on worker lease
2024-12-12T14:14:33.552+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 9: released lock on worker lease
2024-12-12T14:14:33.552+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 2: acquired lock on worker lease
2024-12-12T14:14:33.552+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 2: released lock on worker lease
2024-12-12T14:14:33.552+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 10: acquired lock on worker lease
2024-12-12T14:14:33.552+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 10: released lock on worker lease
2024-12-12T14:14:33.552+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 5: acquired lock on worker lease
2024-12-12T14:14:33.552+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 5: released lock on worker lease
2024-12-12T14:14:33.552+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 3: acquired lock on worker lease
2024-12-12T14:14:33.552+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 3: released lock on worker lease
2024-12-12T14:14:33.552+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 4: acquired lock on worker lease
2024-12-12T14:14:33.552+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 4: released lock on worker lease
2024-12-12T14:14:33.552+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 11: acquired lock on worker lease
2024-12-12T14:14:33.552+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 11: released lock on worker lease
2024-12-12T14:14:33.552+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] included builds: acquired lock on worker lease
2024-12-12T14:14:33.552+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] included builds: released lock on worker lease
2024-12-12T14:14:33.552+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker: acquired lock on worker lease
2024-12-12T14:14:33.553+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker: released lock on worker lease
2024-12-12T14:14:33.553+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 7: acquired lock on worker lease
2024-12-12T14:14:33.553+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 7: released lock on worker lease
2024-12-12T14:14:33.553+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 8: acquired lock on worker lease
2024-12-12T14:14:33.553+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 8: released lock on worker lease
2024-12-12T14:14:34.934+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
2024-12-12T14:14:34.934+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2024-12-12T14:14:34.934+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2024-12-12T14:14:34.934+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
2024-12-12T14:14:34.934+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2024-12-12T14:14:34.934+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2024-12-12T14:14:44.932+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
2024-12-12T14:14:44.932+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2024-12-12T14:14:44.932+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2024-12-12T14:14:44.932+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
2024-12-12T14:14:44.932+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2024-12-12T14:14:44.932+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2024-12-12T14:14:54.932+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
2024-12-12T14:14:54.932+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2024-12-12T14:14:54.932+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2024-12-12T14:14:54.933+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
2024-12-12T14:14:54.933+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2024-12-12T14:14:54.933+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2024-12-12T14:15:03.551+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Daemon worker: acquired lock on worker lease
2024-12-12T14:15:03.551+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Daemon worker: released lock on worker lease
2024-12-12T14:15:03.551+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 9: acquired lock on worker lease
2024-12-12T14:15:03.551+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 9: released lock on worker lease
2024-12-12T14:15:03.551+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 8: acquired lock on worker lease
2024-12-12T14:15:03.551+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 8: released lock on worker lease
2024-12-12T14:15:03.552+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 7: acquired lock on worker lease
2024-12-12T14:15:03.552+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 7: released lock on worker lease
2024-12-12T14:15:03.552+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker: acquired lock on worker lease
2024-12-12T14:15:03.552+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker: released lock on worker lease
2024-12-12T14:15:03.552+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] included builds: acquired lock on worker lease
2024-12-12T14:15:03.552+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] included builds: released lock on worker lease
2024-12-12T14:15:03.552+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 11: acquired lock on worker lease
2024-12-12T14:15:03.552+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 11: released lock on worker lease
2024-12-12T14:15:03.552+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 4: acquired lock on worker lease
2024-12-12T14:15:03.552+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 4: released lock on worker lease
2024-12-12T14:15:03.552+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 3: acquired lock on worker lease
2024-12-12T14:15:03.552+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 3: released lock on worker lease
2024-12-12T14:15:03.552+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 5: acquired lock on worker lease
2024-12-12T14:15:03.552+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 5: released lock on worker lease
2024-12-12T14:15:03.552+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 10: acquired lock on worker lease
2024-12-12T14:15:03.552+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 10: released lock on worker lease
2024-12-12T14:15:03.552+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 2: acquired lock on worker lease
2024-12-12T14:15:03.552+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 2: released lock on worker lease
2024-12-12T14:15:04.932+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
2024-12-12T14:15:04.932+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2024-12-12T14:15:04.932+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2024-12-12T14:15:04.932+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
2024-12-12T14:15:04.933+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2024-12-12T14:15:04.933+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2024-12-12T14:15:14.930+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
2024-12-12T14:15:14.930+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2024-12-12T14:15:14.930+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2024-12-12T14:15:14.931+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
2024-12-12T14:15:14.931+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2024-12-12T14:15:14.931+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2024-12-12T14:15:24.930+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
2024-12-12T14:15:24.930+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2024-12-12T14:15:24.930+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2024-12-12T14:15:24.931+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
2024-12-12T14:15:24.931+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2024-12-12T14:15:24.931+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2024-12-12T14:15:33.550+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Daemon worker: acquired lock on worker lease
2024-12-12T14:15:33.550+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Daemon worker: released lock on worker lease
2024-12-12T14:15:33.550+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 9: acquired lock on worker lease
2024-12-12T14:15:33.550+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 9: released lock on worker lease
2024-12-12T14:15:33.550+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 2: acquired lock on worker lease
2024-12-12T14:15:33.550+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 2: released lock on worker lease
2024-12-12T14:15:33.550+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 10: acquired lock on worker lease
2024-12-12T14:15:33.550+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 10: released lock on worker lease
2024-12-12T14:15:33.550+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 5: acquired lock on worker lease
2024-12-12T14:15:33.550+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 5: released lock on worker lease
2024-12-12T14:15:33.550+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 3: acquired lock on worker lease
2024-12-12T14:15:33.550+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 3: released lock on worker lease
2024-12-12T14:15:33.550+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 4: acquired lock on worker lease
2024-12-12T14:15:33.550+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 4: released lock on worker lease
2024-12-12T14:15:33.550+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 11: acquired lock on worker lease
2024-12-12T14:15:33.550+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 11: released lock on worker lease
2024-12-12T14:15:33.550+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] included builds: acquired lock on worker lease
2024-12-12T14:15:33.550+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] included builds: released lock on worker lease
2024-12-12T14:15:33.550+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker: acquired lock on worker lease
2024-12-12T14:15:33.550+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker: released lock on worker lease
2024-12-12T14:15:33.550+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 7: acquired lock on worker lease
2024-12-12T14:15:33.550+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 7: released lock on worker lease
2024-12-12T14:15:33.550+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 8: acquired lock on worker lease
2024-12-12T14:15:33.550+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 8: released lock on worker lease
2024-12-12T14:15:34.930+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
2024-12-12T14:15:34.930+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2024-12-12T14:15:34.930+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2024-12-12T14:15:34.931+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
2024-12-12T14:15:34.931+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2024-12-12T14:15:34.931+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2024-12-12T14:15:44.929+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
2024-12-12T14:15:44.929+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2024-12-12T14:15:44.929+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2024-12-12T14:15:44.930+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
2024-12-12T14:15:44.930+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2024-12-12T14:15:44.930+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2024-12-12T14:15:54.929+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
2024-12-12T14:15:54.929+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2024-12-12T14:15:54.929+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2024-12-12T14:15:54.930+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
2024-12-12T14:15:54.930+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2024-12-12T14:15:54.930+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2024-12-12T14:14:26.939+0100 [LIFECYCLE] [class org.gradle.internal.buildevents.TaskExecutionLogger] 
2024-12-12T14:14:26.939+0100 [LIFECYCLE] [class org.gradle.internal.buildevents.TaskExecutionLogger] > Task :policy-enforcer-api:test

System Info (please complete the following information):
On Windows and WSL it behaves similar

  • OS: Windows

  • GraalVM Version: GraalVM 22.3.1 Java 19 C

  • Java Version: 19.0.2+7-jvmci-22.3-b12

  • Plugin version 10.0.3

  • OS: WSL

  • GraalVM Version: CE 23.0.1+11.1

  • Java Version: 23.0.1

  • Plugin version 10.0.3

Additional context

After investigation I thought cause of the problems is test sources generation as it triggers gradle file watcher and then daemon locks all checked but running with --no-watch-fs didn't change much.

@kgonia kgonia added the bug Something isn't working label Dec 12, 2024
@melix
Copy link
Collaborator

melix commented Dec 12, 2024

You should be very careful when interpreting locks in Gradle. It's basically locks waiting for the test task to finish. The fact of using the agent will not have any influence on how Gradle uses locks or not. However, the agent may be responsible for slower tests.

@kgonia
Copy link
Author

kgonia commented Dec 12, 2024

So if the agent itself isn't causing the issue, could it be that using the agent extends the test execution time enough that more locks are being acquired?

@melix
Copy link
Collaborator

melix commented Dec 12, 2024

That's what I would think, yes.

@vjovanov
Copy link
Member

In some particular cases the agent can be up to 10x slower than the original execution. @kgonia would it be possible to pinpoint which test is causing this so we can try to optimize it?

@vjovanov vjovanov self-assigned this Dec 16, 2024
@kgonia
Copy link
Author

kgonia commented Dec 17, 2024

In general, I noticed this during Spring tests. My guess is that it’s related to proxies, especially CGLIB proxies, but that's a very rough assumption. I can try to distill more concrete clues.

@vjovanov
Copy link
Member

Also, is this with conditional metadata collection or just the regular run?

@kgonia
Copy link
Author

kgonia commented Dec 18, 2024

I'm using conditional metadata collection. In the project I tried to run, it takes over 1 hour with the agent versus 4 minutes without it. It’s around 120 integration tests using MockMvc.

I also tried my configuration with spring-petclinic, but the differences here are much smaller:

./gradlew test --rerun
BUILD SUCCESSFUL in 1m 28s

Agent (standard):
./gradlew -Pagent test --rerun -x :processTestAot -x aotTestClasses -x compileAotTestJava
BUILD SUCCESSFUL in 2m 16s

Agent (conditional):
./gradlew -Pagent test --rerun -x :processTestAot -x aotTestClasses -x compileAotTestJava
BUILD SUCCESSFUL in 3m 43s

@vjovanov
Copy link
Member

Thanks for all the details. This ticket better fits the GraalVM issue tracker. Could you please re-open it there and we will have a look if this can be optimized?

CC @DSouzaM

@kgonia
Copy link
Author

kgonia commented Dec 19, 2024

Sure, Here is the ticket oracle/graal#10352

@vjovanov
Copy link
Member

Thank you, we can continue with further discussion and the fixes there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants