ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject ambari git commit: AMBARI-14799 Metric Monitor crashes with NoSuchProcess exception (dsen)
Date Wed, 27 Jan 2016 12:13:13 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 7d188b63a -> bc9285e38


AMBARI-14799 Metric Monitor crashes with NoSuchProcess exception (dsen)


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

Branch: refs/heads/branch-2.2
Commit: bc9285e381054f688540f1f275d2cffffbbfb18d
Parents: 7d188b6
Author: Dmytro Sen <dsen@apache.org>
Authored: Wed Jan 27 14:06:18 2016 +0200
Committer: Dmytro Sen <dsen@apache.org>
Committed: Wed Jan 27 14:09:44 2016 +0200

----------------------------------------------------------------------
 .../src/main/python/core/host_info.py                        | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/bc9285e3/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/host_info.py
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/host_info.py
b/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/host_info.py
index 23fc4de..007dd42 100644
--- a/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/host_info.py
+++ b/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/host_info.py
@@ -90,8 +90,12 @@ class HostInfo():
     proc_total = 0
     for proc in proc_stats:
       proc_total += 1
-      if STATUS_RUNNING == proc.status():
-        proc_run += 1
+      try:
+        if STATUS_RUNNING == proc.status():
+          proc_run += 1
+      except (psutil.NoSuchProcess, psutil.AccessDenied) as e:
+        #NOP
+        pass
     pass
 
     return {


Mime
View raw message