]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Add greenthread.sleep() to parent wait()
authorscott-dangelo <scott.dangelo@hp.com>
Fri, 22 Nov 2013 16:28:07 +0000 (16:28 +0000)
committerscott-dangelo <scott.dangelo@hp.com>
Fri, 22 Nov 2013 16:37:52 +0000 (16:37 +0000)
Add an eventlet.greenthread.sleep() to wait() to keep
cinder-volume parent from looping after catching SIGTERM
and hogging the CPU. This was already added to the running
state but is missing from the SIGTERM caught state when
the parent waits to reap the child.

Change-Id: Ia871e31db5bf9ec4e86f926f8f6c4f0f4ecb7925
Closes-Bug: #1254089

cinder/service.py

index 73e3027ea01dd6285fc9d379d499fac7e3e110ca..40a51b395ce58d4ccab5601cf3c4d9b7c076936a 100644 (file)
@@ -323,7 +323,10 @@ class ProcessLauncher(object):
         if self.children:
             LOG.info(_('Waiting on %d children to exit'), len(self.children))
             while self.children:
-                self._wait_child()
+                wrap = self._wait_child()
+                if not wrap:
+                    eventlet.greenthread.sleep(.01)
+                    continue
 
 
 class Service(object):