diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/RecoveredReplicationSourceShipper.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/RecoveredReplicationSourceShipper.java index 471ca68f6599..b01df7db8493 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/RecoveredReplicationSourceShipper.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/RecoveredReplicationSourceShipper.java @@ -97,8 +97,10 @@ private void terminate(String reason, Exception cause) { "Closing worker for wal group " + this.walGroupId + " because an error occurred: " + reason, cause); } - entryReader.interrupt(); - Threads.shutdown(entryReader, sleepForRetries); + if (entryReader != null) { + entryReader.interrupt(); + Threads.shutdown(entryReader, sleepForRetries); + } this.interrupt(); Threads.shutdown(this, sleepForRetries); LOG.info("ReplicationSourceWorker {} terminated", this.getName());