Commit 3c3046d0 authored by Andre Freyssinet's avatar Andre Freyssinet

JMQ-240: Allows to stop an already stopped server without warning.

parent f115b9e7
......@@ -1765,10 +1765,16 @@ public final class AgentServer {
logmon.log(BasicLevel.INFO, getName() + ", stop()");
synchronized(status) {
if ((status.value != Status.STARTED) &&
(status.value != Status.STOPPED)) {
if ((status.value == Status.STOPPED) || (status.value == Status.INSTALLED)) {
// The server is already stopped.
if (logmon.isLoggable(BasicLevel.DEBUG))
logmon.log(BasicLevel.DEBUG,
getName() + " not running, status: " + getStatusInfo(), new Exception());
return;
}
if (status.value != Status.STARTED) {
logmon.log(BasicLevel.WARN,
getName() + "cannot stop, bad status: " + getStatusInfo());
getName() + " cannot stop, bad status: " + getStatusInfo());
return;
}
status.value = Status.STOPPING;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment