From 8931393302c67053e7d8d8c57c5970732cea4f8d Mon Sep 17 00:00:00 2001 From: ConfX <114765570+teamconfx@users.noreply.github.com> Date: Fri, 29 Sep 2023 01:36:24 -0500 Subject: [PATCH] HDFS-17133: TestFsDatasetImpl missing null check when cleaning up (#6079). Contributed by ConfX. Signed-off-by: Ayush Saxena --- .../server/datanode/fsdataset/impl/TestFsDatasetImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/TestFsDatasetImpl.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/TestFsDatasetImpl.java index 1c94e351c2b52..585c36fa995e8 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/TestFsDatasetImpl.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/TestFsDatasetImpl.java @@ -1173,7 +1173,7 @@ private void testMoveBlockFailure(Configuration config) { LOG.info("Exception in testMoveBlockFailure ", ex); fail("Exception while testing testMoveBlockFailure "); } finally { - if (cluster.isClusterUp()) { + if (cluster != null && cluster.isClusterUp()) { cluster.shutdown(); } } @@ -1984,4 +1984,4 @@ public void tesInvalidateMissingBlock() throws Exception { cluster.shutdown(); } } -} \ No newline at end of file +}