Gradlew --stop kills all gradleprocesses (even non-daemon)

(Jem Mawson) #1

EDIT: Actually the daemon is on by default. What we once thought was a non-daemon build is now kicking off a separate daemon process. This breaks our CI build.

Running a non-daemon build in one terminal, and then calling

gradlew --stop

in another terminal will kill the first process with the following error:

* Exception is:
org.gradle.launcher.daemon.server.DaemonStoppedException: daemon explicitly stopped while busy, execution when stopped = DaemonCommandExecution[command = BuildAndStop{id=e5181bba-7
7d9-40ab-8e49-33a4b274354d.1, currentDir=c:\projects\dnrs_z}, connection = org.gradle.launcher.daemon.server.DefaultDaemonConnection@537da7f4]
        at org.gradle.launcher.daemon.server.DaemonStateCoordinator.stopOnIdleTimeout(
        at org.gradle.launcher.daemon.server.Daemon.requestStopOnIdleTimeout(
        at org.gradle.launcher.daemon.bootstrap.DaemonMain.doAction(
        at org.gradle.launcher.daemon.bootstrap.DaemonMain.main(
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(
        at java.lang.reflect.Method.invoke(
        at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(
        at org.gradle.launcher.daemon.bootstrap.GradleDaemon.main(
  Daemon vm is shutting down... The daemon has exited normally or was terminated in response to a user interrupt.
----- End of the daemon log -----
    FAILURE: Build failed with an exception.
  * What went wrong:
Unable to dispatch the message to the daemon.
  * Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

It seems that ‘–stop’ kills all gradleprocesses and not just the daemon.

Gradle 1.3
  Gradle build time: Tuesday, 20 November 2012 11:37:38 AM UTC
Groovy: 1.8.6
Ant: Apache Ant(TM) version 1.8.4 compiled on May 22 2012
Ivy: 2.2.0
JVM: 1.7.0_05 (Oracle Corporation 23.1-b03)
OS: Windows 7 6.1 amd64

(Peter Niederwieser) #2

‘gradlew --stop’ only stops daemons. Using the daemon is not the default; you must specify it somewhere (command line, GRADLE_OPTS,

(slamacchia) #3

I found the problem Jeremy. Have a read of this: