Skip to content

Deadlock in Rendering stage #2926

@daymxn

Description

@daymxn

Describe the bug
When running Dokka on machines with less than two CPU cores, certain projects end up causing a deadlock during the rendering stage.

Expected behaviour
Dokka should continue building documentation without any issue, and not cause a deadlock.

To Reproduce
It seems to occur specifically in our firebase-common artifact over at firebase-android-sdk when building our docs.

If you clone our repo in a VM or Docker container that is limited to two CPU cores- and run ./gradlew :firebase-common:kotlindoc, it will freeze during the rendering stage.

Dokka configuration
I've uploaded it as a gist since it's a bit lengthy.

Installation

  • Operating system: Linux
  • Build tool: Gradle v7.6.0
  • Dokka version: 1.8.10-dev-203

Additional context
After getting copies of Github's runner images, and simulating the environment in a docker image- I've managed to reproduce the issue. This occurs when the CPUs are limited to 2 cores; as is the case with standard github runner machines. It seems to be a deadlock. Logging into the deadlocked container, I've managed to get stack traces.

Relevant Running Processes:

root         205     199  1 20:12 pts/1    00:00:13 /opt/hostedtoolcache/Java_Zulu_jdk/11.0.18-10/x64/bin/java -Xmx64m -Xms64m -Dorg.gradle.appname=gradlew -classpath /usr/local/google/home/daymxn/Documents/repos/firebase-android-sdk/gradle/wrapper/gradle-wrapper.jar org.gradle.wrapper.GradleWrapperMain --no-daem
on :firebase-common:kotlindoc

root         241     205 25 20:13 ?        00:05:42 /opt/hostedtoolcache/Java_Zulu_jdk/11.0.18-10/x64/bin/java -XX:MaxPermSize=8g --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UN
NAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED -Xms2g -Xmx8g -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant -cp /root/.gradle/wrapper/dists/gradle-7.6-all/9f832ih6bniajn45pbmq
hk2cw/gradle-7.6/lib/gradle-launcher-7.6.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 7.6

root         343     241  3 20:14 ?        00:00:39 /opt/hostedtoolcache/Java_Zulu_jdk/11.0.18-10/x64/bin/java -cp /root/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-compiler-embeddable/1.7.10/909803167c98606fcf22b4c848647c68e351d48d/kotlin-compiler-embeddable-1.7.10.jar:/root/.gradle/caches/mod
ules-2/files-2.1/org.jetbrains.kotlin/kotlin-reflect/1.7.10/165e600dfea6185cf5efa700756294cc4904dbeb/kotlin-reflect-1.7.10.jar:/root/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.7.10/d2abf9e77736acc4450dc4a3f707fa2c10f5099d/kotlin-stdlib-1.7.10.jar:/root/.gradle/caches/modules-2/files-2
.1/org.jetbrains.kotlin/kotlin-script-runtime/1.7.10/c99c87a6988d8fd8d5142e9ed5c9f34a7cf561ee/kotlin-script-runtime-1.7.10.jar:/root/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-daemon-embeddable/1.7.10/3a9f7aef7080d3ae63126cbba4f827ed664f32fa/kotlin-daemon-embeddable-1.7.10.jar:/root/.gradle/ca
ches/modules-2/files-2.1/org.jetbrains.intellij.deps/trove4j/1.0.20200330/3afb14d5f9ceb459d724e907a21145e8ff394f02/trove4j-1.0.20200330.jar:/root/.gradle/caches/modules-2/files-2.1/net.java.dev.jna/jna/5.6.0/330f2244e9030119ab3030fc3fededc86713d9cc/jna-5.6.0.jar:/root/.gradle/caches/modules-2/files-2.1/org.jetbra
ins.kotlin/kotlin-stdlib-common/1.7.10/bac80c520d0a9e3f3673bc2658c6ed02ef45a76a/kotlin-stdlib-common-1.7.10.jar:/root/.gradle/caches/modules-2/files-2.1/org.jetbrains/annotations/13.0/919f0dfe192fb4e063e7dacadee7f8bb9a2672a9/annotations-13.0.jar -Djava.awt.headless=true -D$java.rmi.server.hostname=127.0.0.1 -Xmx8
g -Dkotlin.environment.keepalive -ea org.jetbrains.kotlin.daemon.KotlinCompileDaemon --daemon-runFilesPath /root/.local/share/kotlin/daemon --daemon-autoshutdownIdleSeconds=7200 --daemon-compilerClasspath /root/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-compiler-embeddable/1.7.10/909803167c986
06fcf22b4c848647c68e351d48d/kotlin-compiler-embeddable-1.7.10.jar:/root/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-reflect/1.7.10/165e600dfea6185cf5efa700756294cc4904dbeb/kotlin-reflect-1.7.10.jar:/root/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.7.10/d2abf9e77736ac
c4450dc4a3f707fa2c10f5099d/kotlin-stdlib-1.7.10.jar:/root/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-script-runtime/1.7.10/c99c87a6988d8fd8d5142e9ed5c9f34a7cf561ee/kotlin-script-runtime-1.7.10.jar:/root/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-daemon-embeddable/1.7.10/3a9
f7aef7080d3ae63126cbba4f827ed664f32fa/kotlin-daemon-embeddable-1.7.10.jar:/root/.gradle/caches/modules-2/files-2.1/org.jetbrains.intellij.deps/trove4j/1.0.20200330/3afb14d5f9ceb459d724e907a21145e8ff394f02/trove4j-1.0.20200330.jar:/root/.gradle/caches/modules-2/files-2.1/net.java.dev.jna/jna/5.6.0/330f2244e9030119
ab3030fc3fededc86713d9cc/jna-5.6.0.jar:/root/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.7.10/bac80c520d0a9e3f3673bc2658c6ed02ef45a76a/kotlin-stdlib-common-1.7.10.jar:/root/.gradle/caches/modules-2/files-2.1/org.jetbrains/annotations/13.0/919f0dfe192fb4e063e7dacadee7f8bb9a2672a9
/annotations-13.0.jar

root         411     241  1 20:17 ?        00:00:19 /opt/hostedtoolcache/Java_Zulu_jdk/11.0.18-10/x64/bin/java -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant -cp /root/.gradle/caches/modules-2/files-2.1/com.google.devsite/dackka-fat/10.10.12/5e0c3f42dd2a1b638dcbda274bcad90dcc3d11a5/dackka-
fat-10.10.12.jar org.jetbrains.dokka.MainKt /tmp/dackkaArgs2855163529207012510.json -loggingLevel DEBUG

Extended Thread dumps:

PID 205

PID 241

PID 343

PID 411

CC @owengray-google for visibility

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugfeedback: GoogleAn issue/PR submitted by colleagues at Google, most likely related to the Android API reference docs

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions