mirror of https://github.com/apache/cassandra
Merge branch 'cassandra-2.1' into cassandra-2.2
This commit is contained in:
commit
a323641ef3
|
|
@ -45,6 +45,7 @@ public final class JVMStabilityInspector
|
|||
|
||||
/**
|
||||
* Certain Throwables and Exceptions represent "Die" conditions for the server.
|
||||
* This recursively checks the input Throwable's cause hierarchy until null.
|
||||
* @param t
|
||||
* The Throwable to check for server-stop conditions
|
||||
*/
|
||||
|
|
@ -65,6 +66,9 @@ public final class JVMStabilityInspector
|
|||
|
||||
if (isUnstable)
|
||||
killer.killCurrentJVM(t);
|
||||
|
||||
if (t.getCause() != null)
|
||||
inspectThrowable(t.getCause());
|
||||
}
|
||||
|
||||
public static void inspectCommitLogThrowable(Throwable t)
|
||||
|
|
|
|||
|
|
@ -58,6 +58,15 @@ public class JVMStabilityInspectorTest
|
|||
killerForTests.reset();
|
||||
JVMStabilityInspector.inspectCommitLogThrowable(new Throwable());
|
||||
assertTrue(killerForTests.wasKilled());
|
||||
|
||||
killerForTests.reset();
|
||||
JVMStabilityInspector.inspectThrowable(new Exception(new IOException()));
|
||||
assertFalse(killerForTests.wasKilled());
|
||||
|
||||
killerForTests.reset();
|
||||
JVMStabilityInspector.inspectThrowable(new Exception(new OutOfMemoryError()));
|
||||
assertTrue(killerForTests.wasKilled());
|
||||
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue