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)) {