ConfX created HDFS-17443:
----------------------------
Summary: TestNameEditsConfigs does not check null before closing
fileSys and cluster
Key: HDFS-17443
URL: https://issues.apache.org/jira/browse/HDFS-17443
Project: Hadoop HDFS
Issue Type: Bug
Reporter: ConfX
h2. What happened:
Got NullPointerException when trying to run TestNameEditsConfigs with
misconfiguration rather than the actual exception.
h2. Buggy code:
{code:java}
@Test
public void testNameEditsConfigsFailure() throws IOException {
...
} finally {
fileSys.close(); // here fileSys might be null
cluster.shutdown();
}{code}
h2. StackTrace:
{code:java}
java.lang.NullPointerException: Cannot invoke
"org.apache.hadoop.fs.FileSystem.close()" because "fileSys" is null
at
org.apache.hadoop.hdfs.server.namenode.TestNameEditsConfigs.testNameEditsConfigsFailure(TestNameEditsConfigs.java:450){code}
h2. How to reproduce:
(1) Set {{dfs.namenode.edits.dir.minimum}} to {{251625215}}
(2) Run test:
{{org.apache.hadoop.hdfs.server.namenode.TestNameEditsConfigs#testNameEditsConfigsFailure}}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]