[core] Only update the running chunk to STOPPED when stopping computations

Chunks of that node that are already in the `SUCCESS` state will not be
updated, and those that are `SUBMITTED` but not `RUNNING` will be reset
to `NONE`.
This commit is contained in:
Candice Bentéjac 2023-11-22 20:11:51 +01:00
parent bb9195f995
commit f51bf18a25

View file

@ -429,7 +429,11 @@ class NodeChunk(BaseObject):
self.upgradeStatusTo(Status.SUCCESS)
def stopProcess(self):
self.upgradeStatusTo(Status.STOPPED)
if not self.isExtern():
if self._status.status == Status.RUNNING:
self.upgradeStatusTo(Status.STOPPED)
elif self._status.status == Status.SUBMITTED:
self.upgradeStatusTo(Status.NONE)
self.node.nodeDesc.stopProcess(self)
def isExtern(self):
@ -942,8 +946,7 @@ class BaseNode(BaseObject):
def stopComputation(self):
""" Stop the computation of this node. """
for chunk in self._chunks.values():
if not chunk.isExtern():
chunk.stopProcess()
chunk.stopProcess()
def getGlobalStatus(self):
"""