license-gradle-plugin
license-gradle-plugin copied to clipboard
Taking 2 hours to run when gradle dependency graph changed
I can't figure this out, but I changed some project dependencies, and now it's running for hours and repeating the same log lines over and over again. They're fairly normal log lines, but they're just looping.
03:24:30.082 [DEBUG] [org.gradle.internal.component.model.ComponentAttributeMatcher] Selected match com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.9.5 configuration default from candidates [com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.9.5 configuration default] for {}
That's a sample line: I jsut get millions of those.
It's using 100% CPU. I did a visualvm stack snapshot; it seems to be recursing heavily, resolving things, adding things to sets, grouping things, but ... it's like something in the config has made it go exponential. There's no definitive place where it loses the time.
No logging with -i, only with -d.
19:30:04.196 [DEBUG] [org.gradle.internal.progress.DefaultBuildOperationExecutor] Build operation 'Resolve files of :compilerworks-libs:runtime' started
19:30:04.196 [DEBUG] [org.gradle.internal.progress.DefaultBuildOperationExecutor] Completing Build operation 'Resolve files of :compilerworks-libs:runtime'
19:30:04.196 [DEBUG] [org.gradle.internal.progress.DefaultBuildOperationExecutor] Build operation 'Resolve files of :compilerworks-libs:runtime' completed
19:30:04.196 [DEBUG] [nl.javadude.gradle.plugins.license.LicenseResolver] Project compilerworks-libs found 77 dependencies to handle.
But then it goes and does the same project(s) again and again.
I've narrowed it down to one (newly-introduced) inter-module dependency in my code, but it doesn't introduce a cycle. Is it possible that the way the algorithm is written is exponential, and this just triggered a bad case? We have about 100 modules in our Gradle build, but that's not a very high number.
So, the build completed, but took 2h 20mins instead of its normal 45 mins, and all that time was spent in the license plugin. I've changed some deps around, and now the license plugin is fast again, but I'm nervous.
It's manifested on another machine, taking minutes instead of seconds to run.
Trying to solve a similar issue with this PR https://github.com/hierynomus/license-gradle-plugin/pull/203