accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ktur...@apache.org
Subject [50/50] git commit: ACCUMULO-1000 more timeout handling
Date Tue, 23 Jul 2013 16:55:15 GMT
ACCUMULO-1000 more timeout handling


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

Branch: refs/heads/ACCUMULO-1000
Commit: 95931ea0bb7c41210758c37ec0cd9aa873772e67
Parents: 79019ef
Author: Keith Turner <kturner@apache.org>
Authored: Tue Jul 23 12:54:12 2013 -0400
Committer: Keith Turner <kturner@apache.org>
Committed: Tue Jul 23 12:54:12 2013 -0400

----------------------------------------------------------------------
 .../accumulo/core/client/impl/ConditionalWriterImpl.java    | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/95931ea0/core/src/main/java/org/apache/accumulo/core/client/impl/ConditionalWriterImpl.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/ConditionalWriterImpl.java
b/core/src/main/java/org/apache/accumulo/core/client/impl/ConditionalWriterImpl.java
index 55aa718..157b6cb 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/ConditionalWriterImpl.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/ConditionalWriterImpl.java
@@ -85,7 +85,7 @@ class ConditionalWriterImpl implements ConditionalWriter {
   
   private static final Logger log = Logger.getLogger(ConditionalWriterImpl.class);
 
-  private static final int MAX_SLEEP = 5000;
+  private static final int MAX_SLEEP = 30000;
 
   private static final long SESSION_CACHE_TIME = 60000;
 
@@ -592,13 +592,15 @@ class ConditionalWriterImpl implements ConditionalWriter {
     
     long sleepTime = 50;
 
+    long startTime = System.currentTimeMillis();
+
     while (true) {
       Map<String,TabletServerMutations<QCMutation>> binnedMutations = new HashMap<String,TabletLocator.TabletServerMutations<QCMutation>>();
       List<QCMutation> failures = new ArrayList<QCMutation>();
       
       locator.binMutations(mutList, binnedMutations, failures, credentials);
       
-      // TODO do failures matter? not if failures only indicates tablets are not assigned
+      // failures should not matter, if failures only indicates tablets are not assigned
       
       if (!binnedMutations.containsKey(location)) {
         // the tablets are at different locations now, so there is no need to invalidate
the session
@@ -616,6 +618,9 @@ class ConditionalWriterImpl implements ConditionalWriter {
         locator.invalidateCache(location);
       }
       
+      if ((System.currentTimeMillis() - startTime) + sleepTime > timeout)
+        throw new TimedOutException(Collections.singleton(location));
+
       UtilWaitThread.sleep(sleepTime);
       sleepTime = Math.min(2 * sleepTime, MAX_SLEEP);
 


Mime
View raw message