I need to have multiple idle daemons, but it seems like Gradle stops a daemon if there is another one idle with the same configuration. I get the following in the daemon log :
2023-07-06T22:57:03.856+0000 [LIFECYCLE] [org.gradle.launcher.daemon.server.DaemonStateCoordinator] Daemon will be stopped at the end of the build other compatible daemons were started and after being idle for 0 minutes and not recently used
2023-07-06T22:57:03.856+0000 [DEBUG] [org.gradle.launcher.daemon.server.DaemonStateCoordinator] Marking daemon stopped due to other compatible daemons were started and after being idle for 0 minutes and not recently used. The daemon is running a build: false
2023-07-06T22:57:03.856+0000 [DEBUG] [org.gradle.launcher.daemon.server.DaemonStateCoordinator] daemon has stopped.
(Gradle version 8.1.1)
Is there a way to instruct Gradle not to stop a daemon just because there is another one idle for the same configuration?
I have a server that does gradle builds for remote users. Sometimes a build request comes when another build is running. I want to reuse a previously started second daemon because it takes a long time for a daemon to start.
Well, I’m not aware of any way of doing it, besides triggering a build every <10 seconds.
Because 10 seconds is the hard-coded grace period before all compatible, daemons that are not the most recently used ones are expired.
Thanks for the information, it may actually work for me. I will try starting a build with no tasks every 9 seconds or so and see if it actually speed up things.