Gradle Daemon holding up the buildbot CI


(Ante Ilic) #1

I am runninng the gradle via our CI server implemented in buildbot, the daemon starts up however it is being considered a child of the process that started it which in turn leaves the job run hanging until it timeouts. Once I kill the java daemon process the the job successfully finishes.

This happens on windows machine (windows 7 service pack 1) any idea what might be causing this or how I might avoid it?

Let me know if additional information is needed.


(Sterling Greene) #2

Right now, the recommendation is to not use the daemon for CI builds because it mixes state from previous builds with the current one and causes problems with some CI servers (like you’ve seen). We’re updating the Daemon chapter to reflect that.


(Sterling Greene) #3

https://issues.gradle.org/browse/GRADLE-3265


(Luke Daley) #4

Hi Ante,

As Sterling says, we don’t recommend using the Daemon for CI builds. Is there a specific reason you’re doing this?

If you’re not intending to use the Daemon, but are due to environment settings, you can explicitly prevent the daemon from being used by adding ‘–no-daemon’ to the command used to launch the build.


(Ante Ilic) #5

Hi Luke,

I am moving a large C++ code base over to gradle and as a part of the move ( as the move will happen in a series of steps ) I will need to invoke gradle several times as part of the same build step. So I wanted to use the gradle daemon to reduce the startup cost of gradle. I did talk with Sterling and he mentioned that I could start the daemon at the begining of my build/compile step and then just shut it down with “gradle --stop” at the end. That is what I am currently going for but if you have a better idea I am open to it.

Also I did workaround the problem for now by using “–no-daemon” but I think the use case I have would benefit very much from having the daemon on all the time.

Regards, Ante