From ec291f8fc9b65d61d11fa5043e376f7abe9e080f Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Fri, 24 Jun 2011 13:59:30 +0000 Subject: [PATCH] Fix problem where an xcatd instance consumes lots of processor time while shutting down git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@9925 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/sbin/xcatd | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/xCAT-server/sbin/xcatd b/xCAT-server/sbin/xcatd index 9f3878eb7..3e7b46d23 100755 --- a/xCAT-server/sbin/xcatd +++ b/xCAT-server/sbin/xcatd @@ -811,7 +811,13 @@ if ($inet6support) { close($mainpidfile); } if ($listener) { $listener->close; } -while (keys %immediatechildren) { yield(); } +my $lastpid; +while (keys %immediatechildren) { + $lastpid=wait(); + if ($immediatechildren{$lastpid}) { + delete $immediatechildren{$lastpid}; + } +} xCAT::Table::shut_dbworker; if ($dbmaster) { kill 2, $dbmaster;