mirror of https://github.com/apache/cassandra
Avoid potential NPE in JVMStabilityInspector
Patch by Sam Tunnicliffe; reviewed by David Capwell for CASSANDRA-16294
This commit is contained in:
parent
bfd5d20a13
commit
068d87acfb
|
|
@ -1,4 +1,5 @@
|
|||
3.0.24:
|
||||
* Avoid potential NPE in JVMStabilityInspector (CASSANDRA-16294)
|
||||
* Improved check of num_tokens against the length of initial_token (CASSANDRA-14477)
|
||||
* Fix a race condition on ColumnFamilyStore and TableMetrics (CASSANDRA-16228)
|
||||
* Remove the SEPExecutor blocking behavior (CASSANDRA-16186)
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ public final class JVMStabilityInspector
|
|||
|
||||
// Check for file handle exhaustion
|
||||
if (t instanceof FileNotFoundException || t instanceof SocketException)
|
||||
if (t.getMessage().contains("Too many open files"))
|
||||
if (t.getMessage() != null && t.getMessage().contains("Too many open files"))
|
||||
isUnstable = true;
|
||||
|
||||
if (isUnstable)
|
||||
|
|
|
|||
|
|
@ -117,6 +117,14 @@ public class JVMStabilityInspectorTest
|
|||
JVMStabilityInspector.inspectThrowable(new FileNotFoundException("Also should not fail"));
|
||||
assertFalse(killerForTests.wasKilled());
|
||||
|
||||
killerForTests.reset();
|
||||
JVMStabilityInspector.inspectThrowable(new SocketException());
|
||||
assertFalse(killerForTests.wasKilled());
|
||||
|
||||
killerForTests.reset();
|
||||
JVMStabilityInspector.inspectThrowable(new FileNotFoundException());
|
||||
assertFalse(killerForTests.wasKilled());
|
||||
|
||||
killerForTests.reset();
|
||||
JVMStabilityInspector.inspectThrowable(new SocketException("Too many open files"));
|
||||
assertTrue(killerForTests.wasKilled());
|
||||
|
|
@ -124,6 +132,7 @@ public class JVMStabilityInspectorTest
|
|||
killerForTests.reset();
|
||||
JVMStabilityInspector.inspectCommitLogThrowable(new FileNotFoundException("Too many open files"));
|
||||
assertTrue(killerForTests.wasKilled());
|
||||
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue