You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by wc...@apache.org on 2020/10/14 17:09:21 UTC
[hbase] branch master updated: HBASE-25117 ReplicationSourceShipper
thread can not be finished (#2521)
This is an automated email from the ASF dual-hosted git repository.
wchevreuil pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hbase.git
The following commit(s) were added to refs/heads/master by this push:
new 78b7244 HBASE-25117 ReplicationSourceShipper thread can not be finished (#2521)
78b7244 is described below
commit 78b7244091f294d7e2f59a563d34dac7cf722cd7
Author: XinSun <dd...@gmail.com>
AuthorDate: Thu Oct 15 01:08:54 2020 +0800
HBASE-25117 ReplicationSourceShipper thread can not be finished (#2521)
Signed-off-by: Wellington Chevreuil <we...@gmail.com>
Signed-off-by: stack <st...@apache.org>
Signed-off-by: Guanghao Zhang <zg...@apache.org>
Signed-off-by: Duo Zhang <zh...@apache.org>
---
.../regionserver/HBaseInterClusterReplicationEndpoint.java | 5 +++--
.../hadoop/hbase/replication/regionserver/ReplicationSource.java | 6 +++---
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/HBaseInterClusterReplicationEndpoint.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/HBaseInterClusterReplicationEndpoint.java
index b127b46..56bccc0 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/HBaseInterClusterReplicationEndpoint.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/HBaseInterClusterReplicationEndpoint.java
@@ -193,7 +193,7 @@ public class HBaseInterClusterReplicationEndpoint extends HBaseReplicationEndpoi
* @param sleepMultiplier by how many times the default sleeping time is augmented
* @return True if <code>sleepMultiplier</code> is < <code>maxRetriesMultiplier</code>
*/
- protected boolean sleepForRetries(String msg, int sleepMultiplier) {
+ private boolean sleepForRetries(String msg, int sleepMultiplier) {
try {
if (LOG.isTraceEnabled()) {
LOG.trace("{} {}, sleeping {} times {}",
@@ -201,8 +201,9 @@ public class HBaseInterClusterReplicationEndpoint extends HBaseReplicationEndpoi
}
Thread.sleep(this.sleepForRetries * sleepMultiplier);
} catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
if (LOG.isDebugEnabled()) {
- LOG.debug("{} Interrupted while sleeping between retries", logPeerId());
+ LOG.debug("{} {} Interrupted while sleeping between retries", msg, logPeerId());
}
}
return sleepMultiplier < maxRetriesMultiplier;
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java
index b68e058..8091d0c 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java
@@ -691,6 +691,9 @@ public class ReplicationSource implements ReplicationSourceInterface {
}
}
+ if (this.replicationEndpoint != null) {
+ this.replicationEndpoint.stop();
+ }
for (ReplicationSourceShipper worker : workers) {
if (worker.isAlive() || worker.entryReader.isAlive()) {
try {
@@ -711,9 +714,6 @@ public class ReplicationSource implements ReplicationSourceInterface {
}
}
- if (this.replicationEndpoint != null) {
- this.replicationEndpoint.stop();
- }
if (join) {
for (ReplicationSourceShipper worker : workers) {
Threads.shutdown(worker, this.sleepForRetries);