Commit 1f5e7a3f authored by Sebastien Robin's avatar Sebastien Robin

save memory by stopping supervisor

between to test suite launch, it is not needed to keep
supervidor running. This allows to save memory usage
parent f1727fa7
......@@ -67,6 +67,18 @@ def getInputOutputFileList(config, command_name):
slapos_controler = None
def killPreviousRun(process_group_pid_set, supervisord_pid_file):
for pgpid in process_group_pid_set:
try:
os.killpg(pgpid, signal.SIGTERM)
except:
pass
try:
if os.path.exists(supervisord_pid_file):
os.kill(int(open(supervisord_pid_file).read().strip()), signal.SIGTERM)
except:
pass
def run(args):
config = args[0]
slapgrid = None
......@@ -118,11 +130,7 @@ branch = %(branch)s
while True:
# kill processes from previous loop if any
try:
for pgpid in process_group_pid_set:
try:
os.killpg(pgpid, signal.SIGTERM)
except:
pass
killPreviousRun(process_group_pid_set, supervisord_pid_file)
process_group_pid_set.clear()
full_revision_list = []
# Make sure we have local repository
......@@ -233,13 +241,4 @@ branch = %(branch)s
# groups working only in POSIX compilant systems
# Exceptions are swallowed during cleanup phase
print "going to kill %r" % (process_group_pid_set,)
for pgpid in process_group_pid_set:
try:
os.killpg(pgpid, signal.SIGTERM)
except:
pass
try:
if os.path.exists(supervisord_pid_file):
os.kill(int(open(supervisord_pid_file).read().strip()), signal.SIGTERM)
except:
pass
\ No newline at end of file
killPreviousRun(process_group_pid_set, supervisord_pid_file)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment