mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
Final check for running procs (#35292)
* Final check for running procs This does a final check to kill any running procs that are lingering. * Lint
This commit is contained in:
parent
15d088c15f
commit
a3e29c8274
@ -524,7 +524,12 @@ class SaltDaemonScriptBase(SaltScriptBase, ShellTestCase):
|
||||
except psutil.NoSuchProcess:
|
||||
children.remove(child)
|
||||
if children:
|
||||
psutil.wait_procs(children, timeout=5)
|
||||
try:
|
||||
# If we *still* have children, go ahead and attempt to use os.kill() to destroy them
|
||||
psutil.wait_procs(children, timeout=5, callback=lambda nukeem: [os.kill(child.pid, signal.SIGKILL) for child in children])
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
log.info('%s %s DAEMON terminated', self.display_name, self.__class__.__name__)
|
||||
|
||||
def wait_until_running(self, timeout=None):
|
||||
|
Loading…
Reference in New Issue
Block a user