HBASE-14772 Improve zombie detector; be more discerning; ADDENDUM fix 
zombie-detectors' handling of no processes -- was treating no processes as one 
possible zombie


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

Branch: refs/heads/hbase-12439
Commit: 44367f55e8bbd252ae824d1ddb626b5ce91fe75d
Parents: 7b80c80
Author: stack <st...@apache.org>
Authored: Mon Nov 9 13:43:32 2015 -1000
Committer: stack <st...@apache.org>
Committed: Mon Nov 9 13:43:43 2015 -1000

----------------------------------------------------------------------
 dev-support/zombie-detector.sh | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/44367f55/dev-support/zombie-detector.sh
----------------------------------------------------------------------
diff --git a/dev-support/zombie-detector.sh b/dev-support/zombie-detector.sh
index a7856eb..e20828f 100755
--- a/dev-support/zombie-detector.sh
+++ b/dev-support/zombie-detector.sh
@@ -99,8 +99,12 @@ find_processes () {
 ### Look for zombies
 zombies () {
   ZOMBIES=`find_processes`
-  # xargs trims white space before and after the count
-  ZOMBIE_TESTS_COUNT=`echo "${ZOMBIES}"|wc -l|xargs`
+  if [[ -z ${ZOMBIES} ]]
+  then
+    ZOMBIE_TESTS_COUNT=0
+  else
+    ZOMBIE_TESTS_COUNT=`echo "${ZOMBIES}"| wc -l| xargs`
+  fi
   if [[ $ZOMBIE_TESTS_COUNT != 0 ]] ; then
     wait=30
     echo "`date` Found ${ZOMBIE_TESTS_COUNT} suspicious java process(es) 
listed below; waiting ${wait}s to see if just slow to stop"

Reply via email to