DAEMON_EXPIRATION
cicd
runtime_error
ai_generated
true
org.gradle.launcher.daemon.server.DaemonExpirationPeriodicCheck: Daemon will be stopped at the end of the build after running for 3 hours and exceeding the 2-hour idle timeout.
ID: cicd/gradle-daemon-stopped-before-finish
82%Fix Rate
85%Confidence
1Evidence
2023-06-15First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| Gradle 7.5 | active | — | — | — |
| Gradle 8.0 | active | — | — | — |
| Gradle 8.2 | active | — | — | — |
Root Cause
Gradle Daemon is configured with a low idle timeout (e.g., 2 hours) and the build runs longer than that, causing the daemon to be killed before the build completes, especially on long-running CI jobs.
generic中文
Gradle守护进程配置了较低的闲置超时时间(例如2小时),而构建运行时间超过了该时间,导致守护进程在构建完成前被终止,尤其在长时间运行的CI任务中。
Official Documentation
https://docs.gradle.org/current/userguide/gradle_daemon.htmlWorkarounds
-
85% success Increase the daemon idle timeout in gradle.properties: org.gradle.daemon.idletimeout=7200000 (2 hours in milliseconds) or set it to 0 to disable idle timeout.
Increase the daemon idle timeout in gradle.properties: org.gradle.daemon.idletimeout=7200000 (2 hours in milliseconds) or set it to 0 to disable idle timeout.
-
80% success Disable the Gradle Daemon for CI builds by adding --no-daemon to the Gradle command, forcing a new JVM for each build.
Disable the Gradle Daemon for CI builds by adding --no-daemon to the Gradle command, forcing a new JVM for each build.
-
75% success Split the build into smaller, parallel tasks to reduce individual build time below the idle timeout threshold.
Split the build into smaller, parallel tasks to reduce individual build time below the idle timeout threshold.
中文步骤
Increase the daemon idle timeout in gradle.properties: org.gradle.daemon.idletimeout=7200000 (2 hours in milliseconds) or set it to 0 to disable idle timeout.
Disable the Gradle Daemon for CI builds by adding --no-daemon to the Gradle command, forcing a new JVM for each build.
Split the build into smaller, parallel tasks to reduce individual build time below the idle timeout threshold.
Dead Ends
Common approaches that don't work:
-
75% fail
The daemon idle timeout is a Gradle configuration parameter, not a cache or runner issue.
-
80% fail
Heap size affects memory, not the daemon's idle timeout behavior.
-
70% fail
The timeout is set in gradle.properties or via command line flags, not by installation.