accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject [1/4] git commit: ACCUMULO-3084 just warn about long timer delays
Date Tue, 26 Aug 2014 22:04:22 GMT
Repository: accumulo
Updated Branches:
  refs/heads/1.6.1-SNAPSHOT 2eabaf75b -> 8808ecbf1


ACCUMULO-3084 just warn about long timer delays


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

Branch: refs/heads/1.6.1-SNAPSHOT
Commit: b164e3b93639ce3cfc156dd7d95375dedc30d706
Parents: 1e0d50e
Author: Eric C. Newton <eric.newton@gmail.com>
Authored: Tue Aug 26 17:17:44 2014 -0400
Committer: Eric C. Newton <eric.newton@gmail.com>
Committed: Tue Aug 26 17:17:44 2014 -0400

----------------------------------------------------------------------
 .../accumulo/server/tabletserver/TabletServer.java  | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/b164e3b9/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java
b/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java
index b9b68bb..1e3e1b1 100644
--- a/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java
+++ b/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java
@@ -234,9 +234,11 @@ public class TabletServer extends AbstractMetricsImpl implements org.apache.accu
   
   private static HashMap<String,Long> prevGcTime = new HashMap<String,Long>();
   private static long lastMemorySize = 0;
+  private static long lastMemoryCheckTime = 0;
   private static long gcTimeIncreasedCount;
   
   private static final long MAX_TIME_TO_WAIT_FOR_SCAN_RESULT_MILLIS = 1000;
+  private static final long TIME_BETWEEN_GC_CHECKS = 5000;
   
   private TabletServerLogger logger;
   
@@ -264,10 +266,12 @@ public class TabletServer extends AbstractMetricsImpl implements org.apache.accu
             }
         }
       }
-    }, 5000, 5000);
+    }, TIME_BETWEEN_GC_CHECKS, TIME_BETWEEN_GC_CHECKS);
   }
   
   private synchronized static void logGCInfo(AccumuloConfiguration conf) {
+    long now = System.currentTimeMillis();
+
     List<GarbageCollectorMXBean> gcmBeans = ManagementFactory.getGarbageCollectorMXBeans();
     Runtime rt = Runtime.getRuntime();
     
@@ -322,12 +326,22 @@ public class TabletServer extends AbstractMetricsImpl implements org.apache.accu
       log.debug(sb.toString());
     }
     
+    if (lastMemoryCheckTime > 0 && lastMemoryCheckTime < now) {
+      long diff = now - lastMemoryCheckTime;
+      if (diff > 2 * TIME_BETWEEN_GC_CHECKS) {
+        log.warn(String.format("Check for long GC pauses not called in a timely fashion %.1f",
diff / 1000.));
+      }
+      lastMemoryCheckTime = now;
+      return;
+    }
+    
     final long keepAliveTimeout = conf.getTimeInMillis(Property.INSTANCE_ZK_TIMEOUT);
     if (maxIncreaseInCollectionTime > keepAliveTimeout) {
       Halt.halt("Garbage collection may be interfering with lock keep-alive.  Halting.",
-1);
     }
     
     lastMemorySize = mem;
+    lastMemoryCheckTime = now;
   }
   
   private TabletStatsKeeper statsKeeper;


Mime
View raw message