license-gradle-plugin icon indicating copy to clipboard operation
license-gradle-plugin copied to clipboard

Taking 2 hours to run when gradle dependency graph changed

Open shevek opened this issue 6 years ago • 7 comments

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.

shevek avatar May 22 '18 02:05 shevek

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.

shevek avatar May 22 '18 02:05 shevek

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.

shevek avatar May 22 '18 02:05 shevek

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.

shevek avatar May 22 '18 02:05 shevek

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.

shevek avatar May 22 '18 03:05 shevek

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.

shevek avatar May 22 '18 03:05 shevek

It's manifested on another machine, taking minutes instead of seconds to run.

shevek avatar May 25 '18 21:05 shevek

Trying to solve a similar issue with this PR https://github.com/hierynomus/license-gradle-plugin/pull/203

fab-10 avatar Nov 16 '21 11:11 fab-10