[core] verify chunk hosts a subprocess before killing it

a chunk can be marked as "RUNNING" without hosting a subprocess, if a node is duplicated in the graph
This commit is contained in:
Yann Lanthony 2018-07-18 17:00:08 +02:00
parent f5d11a8a7a
commit 5897dc13b6

View file

@ -368,6 +368,10 @@ class CommandLineNode(Node):
return cmdPrefix + chunk.node.nodeDesc.commandLine.format(**chunk.node._cmdVars) + cmdSuffix
def stopProcess(self, chunk):
# the same node could exists several times in the graph and
# only one would have the running subprocess; ignore all others
if not hasattr(chunk, "subprocess"):
return
if chunk.subprocess:
# kill process tree
processes = chunk.subprocess.children(recursive=True) + [chunk.subprocess]