accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject [05/15] git commit: ACCUMULO-378 When we fail to get the ReplicaSystem, wait a bit before returning
Date Fri, 06 Jun 2014 15:33:14 GMT
ACCUMULO-378 When we fail to get the ReplicaSystem, wait a bit before returning

It's the sign of a bad configuration (or bad implementation). If we return
immediately, it will get near immediately re-queued and spam the system.


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/24925e11
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/24925e11
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/24925e11

Branch: refs/heads/ACCUMULO-378
Commit: 24925e116339a68917f69dde9a88ef07ca7d1eea
Parents: 028b780
Author: Josh Elser <elserj@apache.org>
Authored: Thu Jun 5 16:00:17 2014 -0400
Committer: Josh Elser <elserj@apache.org>
Committed: Thu Jun 5 16:08:11 2014 -0400

----------------------------------------------------------------------
 .../tserver/replication/ReplicationProcessor.java     | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/24925e11/server/tserver/src/main/java/org/apache/accumulo/tserver/replication/ReplicationProcessor.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/replication/ReplicationProcessor.java
b/server/tserver/src/main/java/org/apache/accumulo/tserver/replication/ReplicationProcessor.java
index f1bba6b..3b3df87 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/replication/ReplicationProcessor.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/replication/ReplicationProcessor.java
@@ -81,7 +81,19 @@ public class ReplicationProcessor implements Processor {
 
     log.debug("Received replication work for {} to {}", file, target);
 
-    ReplicaSystem replica = getReplicaSystem(target);
+    ReplicaSystem replica;
+    try {
+      replica = getReplicaSystem(target);
+    } catch (Exception e) {
+      log.error("Could not instantiate ReplicaSystem for {}, waiting before returning the
work", target, e);
+      try {
+        Thread.sleep(10000);
+      } catch (InterruptedException ie) {
+        Thread.currentThread().interrupt();
+      }
+
+      return;
+    }
 
     Status status;
     try {


Mime
View raw message