[core] taskManager: downgrade status per chunk

Avoid to get trailing "submitted" chunks on the current node when we stop the computation.
This commit is contained in:
Fabien Castan 2021-01-06 09:22:27 +01:00
parent c502ee1e73
commit 4a5995b346

View file

@ -116,8 +116,12 @@ class TaskManager(BaseObject):
def blockRestart(self):
""" Avoid the automatic restart of computing. """
for node in self._nodesToProcess:
if node.getGlobalStatus() in (Status.SUBMITTED, Status.ERROR):
node.upgradeStatusTo(Status.NONE)
chunkCount = 0
for chunk in node.chunks:
if chunk.status.status in (Status.SUBMITTED, Status.ERROR):
chunk.upgradeStatusTo(Status.NONE)
chunkCount += 1
if chunkCount == len(node.chunks):
self.removeNode(node, displayList=True)
self._blockRestart = False