accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject [2/9] git commit: ACCUMULO-3084 just warn about long timer delays
Date Thu, 28 Aug 2014 01:46:02 GMT
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/6f2fd4d3
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/6f2fd4d3
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/6f2fd4d3

Branch: refs/heads/master
Commit: 6f2fd4d3a54bad464dc3eb0982c4e4e2e5590366
Parents: 30a0ca3
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:48:53 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/6f2fd4d3/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