Merge branch 'cassandra-2.1' into cassandra-2.2

This commit is contained in:
Joshua McKenzie 2015-09-29 12:14:18 -04:00
commit a323641ef3
2 changed files with 13 additions and 0 deletions

View File

@ -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)

View File

@ -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
{