mirror of https://github.com/apache/cassandra
error handling when stopdaemon is called
This commit is contained in:
parent
a0e0598c10
commit
1947c9bb58
|
|
@ -22,6 +22,7 @@ import java.io.IOException;
|
|||
import java.lang.management.ManagementFactory;
|
||||
import java.lang.management.MemoryMXBean;
|
||||
import java.lang.management.RuntimeMXBean;
|
||||
import java.rmi.ConnectException;
|
||||
import java.rmi.server.RMIClientSocketFactory;
|
||||
import java.rmi.server.RMISocketFactory;
|
||||
import java.util.AbstractMap;
|
||||
|
|
@ -415,14 +416,23 @@ public class RemoteJmxMBeanAccessor implements MBeanAccessor
|
|||
try
|
||||
{
|
||||
jmxc.close();
|
||||
jmxc = null;
|
||||
mbeanServerConn = null;
|
||||
connected = false;
|
||||
}
|
||||
catch (ConnectException e)
|
||||
{
|
||||
// result of stopdaemon command, if close() call fails, the daemon is shutdown
|
||||
logger.error("Cassandra has shutdown.");
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
// result of 'stopdaemon' command - i.e. if close() call fails, the daemon is shutdown
|
||||
logger.error("Cassandra has shutdown.");
|
||||
logger.error("Failed to close connection to '{}:{}'.", host, port, e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
jmxc = null;
|
||||
mbeanServerConn = null;
|
||||
connected = false;
|
||||
clazzMBanRegistry.clear();
|
||||
namedMBeanRegistry.clear();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue