Skip to content

Commit 44367f5

Browse files
committed
HBASE-14772 Improve zombie detector; be more discerning; ADDENDUM fix zombie-detectors' handling of no processes -- was treating no processes as one possible zombie
1 parent 7b80c80 commit 44367f5

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

dev-support/zombie-detector.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,12 @@ find_processes () {
9999
### Look for zombies
100100
zombies () {
101101
ZOMBIES=`find_processes`
102-
# xargs trims white space before and after the count
103-
ZOMBIE_TESTS_COUNT=`echo "${ZOMBIES}"|wc -l|xargs`
102+
if [[ -z ${ZOMBIES} ]]
103+
then
104+
ZOMBIE_TESTS_COUNT=0
105+
else
106+
ZOMBIE_TESTS_COUNT=`echo "${ZOMBIES}"| wc -l| xargs`
107+
fi
104108
if [[ $ZOMBIE_TESTS_COUNT != 0 ]] ; then
105109
wait=30
106110
echo "`date` Found ${ZOMBIE_TESTS_COUNT} suspicious java process(es) listed below; waiting ${wait}s to see if just slow to stop"

0 commit comments

Comments
 (0)