Kotlin / dokka

API documentation engine for Kotlin

Home Page:https://kotl.in/dokka

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Gradle Dokka build intermittently hangs

ianbrandt opened this issue · comments

Describe the bug
Occasionally my gradlew dokkaHtmlMultiModule CI job hangs indefinitely.

Usually the task completes in just over two hours. When it hangs, I've let it run for 12+ hours before finally killing it.

Expected behaviour
The task always completes.

Screenshots
I'll attach consecutive thread dumps of the hung Gradle Daemon process.

To Reproduce
The issue is intermittent, and I have not been able to reproduce it locally. It would seem the thread dumps will need to be the starting point for troubleshooting.

Dokka configuration

 withType<DokkaMultiModuleTask>().configureEach {
     notCompatibleWithConfigurationCache(
         "Inputs not currently configuration cache compatible."
     )

     moduleName.set("My Project")
 }

 dokkaHtmlMultiModule.configure {
     pluginConfiguration<DokkaBase, DokkaBaseConfiguration> {
         customAssets = listOf(
             // Override the logo image by providing a custom version with
             // the same name as the default.
             rootProject.layout.projectDirectory.file(
                 "shared/dokka/logo-icon.svg"
             ).asFile,
         )

         footerMessage = COPYRIGHT_AS_HTML_DIV
     }
 }

My 'gradle.properties':

org.gradle.caching=true
org.gradle.configuration-cache=true
org.gradle.configureondemand=true
# 6 hours instead of the default 3 (10800000ms)
org.gradle.daemon.idletimeout=21600000
org.gradle.java.compile-classpath-packaging=true
# 10g+ heap size is needed to prevent OutOfMemoryError during Dokka generation
org.gradle.jvmargs=-Xmx11g -Dfile.encoding=UTF-8
org.gradle.parallel=true
kotlin.daemon.jvmargs=-Xmx4g

Installation

  • Operating system: Windows 10
  • Build JVM: OpenJDK 11.0.22
  • Build tool: Gradle v8.7
  • Dokka version: 1.9.20

Additional context
My project has just over 400 Java/Kotlin modules that apply the org.jetbrains.dokka plugin via my project convention precompiled script plugin.
My build agents have 24 available cores each, so this may be a different issue than #2926.

Thread dumps:

  1. thread_dump.zip
  2. thread_redump.zip (~16 min. later)

I diffed the two, and they're nearly identical with the exception of the elapsed times.

Analysis of the first thread dump: https://fastthread.io/my-thread-report.jsp?p=c2hhcmVkLzIwMjQvMDUvOS9lNDc1NjY3MC1hM2E4LTQ4MzktOTRjMi00NzU0NmNiMDJlZjAudHh0LS0xNi0xMC00MQ==&.