This is an automated email from the ASF dual-hosted git repository.
zhangduo pushed a commit to branch branch-2
in repository https://gitbox.apache.org/repos/asf/hbase.git
The following commit(s) were added to refs/heads/branch-2 by this push:
new baad69c1858 HBASE-28598 Fixes NPE for writer object access in
AsyncFSWAL#closeWriter (#5909)
baad69c1858 is described below
commit baad69c18586a4e64966bb25c3a32963dfa8f22d
Author: Vineet Kumar Maheshwari <[email protected]>
AuthorDate: Fri May 17 20:04:17 2024 +0530
HBASE-28598 Fixes NPE for writer object access in AsyncFSWAL#closeWriter
(#5909)
Signed-off-by: Duo Zhang <[email protected]>
---
.../java/org/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 69d5cba244d..f13160a549a 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 @@ public class AsyncFSWAL extends AbstractFSWAL<AsyncWriter>
{
@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)) {