summaryrefslogtreecommitdiffstats
path: root/src/lib/Component.py
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2008-09-09 04:20:38 +0000
committerNarayan Desai <desai@mcs.anl.gov>2008-09-09 04:20:38 +0000
commitdd36b243507feb8a76c8b7dc99779594a2848d23 (patch)
treec850b08dae326fe11a17afdcd5fa9b025f3fa9a2 /src/lib/Component.py
parent926c2d83ef9832a687b9c5276f9c06b453f75a11 (diff)
downloadbcfg2-dd36b243507feb8a76c8b7dc99779594a2848d23.tar.gz
bcfg2-dd36b243507feb8a76c8b7dc99779594a2848d23.tar.bz2
bcfg2-dd36b243507feb8a76c8b7dc99779594a2848d23.zip
Make file monitor selectable
Handle child processes more aggressively git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@4908 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Component.py')
-rw-r--r--src/lib/Component.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/Component.py b/src/lib/Component.py
index 7ee2df515..aca74f7d1 100644
--- a/src/lib/Component.py
+++ b/src/lib/Component.py
@@ -212,6 +212,7 @@ class Component(TLSServer,
# need to add waitpid code here to enforce maxchild
if method in self.fork_funcs:
self.clean_up_children()
+ self.check_for_free_slot()
pid = os.fork()
if pid:
self.children.append(pid)
@@ -252,11 +253,12 @@ class Component(TLSServer,
break
except OSError:
break
+
+ def check_for_free_slot(self):
if len(self.children) >= self.child_limit:
self.logger.info("Reached child_limit; waiting for child exit")
pid = os.waitpid(0, 0)[0]
self.children.remove(pid)
- self.logger.debug("process %d exited" % pid)
def _authenticate_connection(self, method, user, password, address):
'''Authenticate new connection'''