Commit ae52c2f4 authored by Pavel Vainerman's avatar Pavel Vainerman

Fixed bug in terminate

parent 26955657
...@@ -84,7 +84,6 @@ class ChildProc: ...@@ -84,7 +84,6 @@ class ChildProc:
setattr(self, p['name'], p['value']) setattr(self, p['name'], p['value'])
if isinstance(self.restart, bool): if isinstance(self.restart, bool):
print "for '%s' restart is BOOL" % self.cmd
self.restart = int(0) self.restart = int(0)
# internal fields # internal fields
...@@ -215,7 +214,8 @@ def do_monitoring(main_pid, run_list, not_monit): ...@@ -215,7 +214,8 @@ def do_monitoring(main_pid, run_list, not_monit):
monit_process = psutil.Process(main_pid) monit_process = psutil.Process(main_pid)
while not term_check_alive.is_set(): while not term_check_alive.is_set():
try: try:
monit_process.wait(check_alive_period) if not monit_process.wait(check_alive_period):
break
except psutil.TimeoutExpired: except psutil.TimeoutExpired:
pass pass
...@@ -224,7 +224,7 @@ def do_monitoring(main_pid, run_list, not_monit): ...@@ -224,7 +224,7 @@ def do_monitoring(main_pid, run_list, not_monit):
finally: finally:
term_check_alive.set() term_check_alive.set()
if check_alive_thread: if check_alive_thread.is_alive():
check_alive_thread.join() check_alive_thread.join()
terminate_all_process(proc_list) terminate_all_process(proc_list)
......
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