aurora-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zma...@apache.org
Subject aurora git commit: Add metric for counting uncaught exceptions in async executor.
Date Fri, 15 Jan 2016 18:31:05 GMT
Repository: aurora
Updated Branches:
  refs/heads/master 4dff5da84 -> b56367902


Add metric for counting uncaught exceptions in async executor.

Add metric "async_executor_uncaught_exceptions" for tracking uncaught exceptions
in async executor.

Bugs closed: AURORA-1582

Reviewed at https://reviews.apache.org/r/42328/


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

Branch: refs/heads/master
Commit: b563679024670cc8dd6d4dadb8ce0802eff364b5
Parents: 4dff5da
Author: Zameer Manji <zmanji@apache.org>
Authored: Fri Jan 15 10:30:54 2016 -0800
Committer: Zameer Manji <zmanji@apache.org>
Committed: Fri Jan 15 10:30:54 2016 -0800

----------------------------------------------------------------------
 src/main/java/org/apache/aurora/scheduler/base/AsyncUtil.java | 7 +++++++
 1 file changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/aurora/blob/b5636790/src/main/java/org/apache/aurora/scheduler/base/AsyncUtil.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/base/AsyncUtil.java b/src/main/java/org/apache/aurora/scheduler/base/AsyncUtil.java
index 5facc04..80dc35e 100644
--- a/src/main/java/org/apache/aurora/scheduler/base/AsyncUtil.java
+++ b/src/main/java/org/apache/aurora/scheduler/base/AsyncUtil.java
@@ -19,9 +19,11 @@ import java.util.concurrent.Future;
 import java.util.concurrent.ScheduledThreadPoolExecutor;
 import java.util.concurrent.ThreadPoolExecutor;
 import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicLong;
 
 import com.google.common.util.concurrent.ThreadFactoryBuilder;
 
+import org.apache.aurora.common.stats.Stats;
 import org.slf4j.Logger;
 
 import static java.util.Objects.requireNonNull;
@@ -35,6 +37,9 @@ public final class AsyncUtil {
     // Utility class.
   }
 
+  private static final AtomicLong UNCAUGHT_EXCEPTIONS =
+      Stats.exportLong("async_executor_uncaught_exceptions");
+
   /**
    * Creates a {@link ScheduledThreadPoolExecutor} that logs unhandled errors.
    *
@@ -121,10 +126,12 @@ public final class AsyncUtil {
           Thread.currentThread().interrupt();
         } catch (ExecutionException ee) {
           logger.error(ee.toString(), ee);
+          UNCAUGHT_EXCEPTIONS.incrementAndGet();
         }
       }
     } else {
       logger.error(throwable.toString(), throwable);
+      UNCAUGHT_EXCEPTIONS.incrementAndGet();
     }
   }
 }


Mime
View raw message