connection.dispatch(stopCommand);
Result result = (Result) connection.receive();
if (result instanceof Failure) {
failure = ((Failure) result).getValue();
}
connection.dispatch(new Finished());
} catch (Throwable e) {
failure = e;
}
if (failure != null) {
LOGGER.lifecycle("Unable to stop one of the daemons. The daemon may have crashed.");