I've got a "Build" pipeline that runs gradlew build on my java code and then just exports the jar as an artifact.

It is currently running on a self hosted agent as I was hoping this will help speed up the compilation.

I noticed that at the start of every run it says it is starting a new daemon as the stopped ones can't be used.

In the "Finalize job" step it says "Start cleaning up orphan processes." and then "Terminate orphan process: pid (17162) (java)". In the image below you can see that it is indeed terminating the process of the daemon.

image of task and PID

I've tried running gradlew build on the server, and then running the CI and the CI then uses the gradle daemon. But if I have two builds running at once, the daemon will sometimes end as another is active.

Is there any way to stop the cleaning of orphan processes or keep the daemon running?

I've thought of a cron job to build something small to keep it running, but that feels like an awkward way of doing it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.