Skip to content

Commit 5c863bf

Browse files
vineet4008Apache9
authored andcommitted
HBASE-28598 Fixes NPE for writer object access in AsyncFSWAL#closeWriter (#5907)
Signed-off-by: Duo Zhang <zhangduo@apache.org> (cherry picked from commit 17ae116)
1 parent 0ecb6fe commit 5c863bf

File tree

1 file changed

+4
-2
lines changed
  • hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal

1 file changed

+4
-2
lines changed

hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AsyncFSWAL.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -772,8 +772,10 @@ protected void doReplaceWriter(Path oldPath, Path newPath, AsyncWriter nextWrite
772772
@Override
773773
protected void doShutdown() throws IOException {
774774
waitForSafePoint();
775-
closeWriter(this.writer, getOldPath());
776-
this.writer = null;
775+
if (this.writer != null) {
776+
closeWriter(this.writer, getOldPath());
777+
this.writer = null;
778+
}
777779
closeExecutor.shutdown();
778780
try {
779781
if (!closeExecutor.awaitTermination(waitOnShutdownInSeconds, TimeUnit.SECONDS)) {

0 commit comments

Comments
 (0)