From 7b2af6ddfd5aa6c647b2d165e1eaee5b74091779 Mon Sep 17 00:00:00 2001 From: Vineet Kumar Maheshwari Date: Thu, 16 May 2024 12:10:58 +0530 Subject: [PATCH] HBASE-28598 Fixes NPE for writer object access in AsyncFSWAL#closeWriter --- .../apache/hadoop/hbase/regionserver/wal/AsyncFSWAL.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AsyncFSWAL.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AsyncFSWAL.java index 69d5cba244da..f13160a549a1 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AsyncFSWAL.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AsyncFSWAL.java @@ -772,8 +772,10 @@ protected void doReplaceWriter(Path oldPath, Path newPath, AsyncWriter nextWrite @Override protected void doShutdown() throws IOException { waitForSafePoint(); - closeWriter(this.writer, getOldPath()); - this.writer = null; + if (this.writer != null) { + closeWriter(this.writer, getOldPath()); + this.writer = null; + } closeExecutor.shutdown(); try { if (!closeExecutor.awaitTermination(waitOnShutdownInSeconds, TimeUnit.SECONDS)) {