Fix crash when running cloned pipeline that invokes a step twice (#770, related to #769)

Co-authored-by: eajechiloae <97950284+eugen-ajechiloae-clearml@users.noreply.github.com>
This commit is contained in:
tonyd 2022-10-17 13:30:58 -07:00 committed by GitHub
parent aad01056b5
commit 92fbe062b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1228,6 +1228,12 @@ class PipelineController(object):
for node in list(self._nodes.values()): for node in list(self._nodes.values()):
if node.executed is False: if node.executed is False:
node.executed = None node.executed = None
# Associate any nodes that represent second or subsequent calls to a component function with the function.
for node in list(self._nodes.values()):
if not node.base_task_id and not node.task_factory_func and node.job_code_section:
if node.job_code_section in self._nodes:
func = self._nodes[node.job_code_section].task_factory_func
if func: node.task_factory_func = func
if not self._verify(): if not self._verify():
raise ValueError("Failed verifying pipeline execution graph, " raise ValueError("Failed verifying pipeline execution graph, "
"it has either inaccessible nodes, or contains cycles") "it has either inaccessible nodes, or contains cycles")
@ -3476,11 +3482,12 @@ class PipelineDecorator(PipelineController):
_node.parents = [] _node.parents = []
# find a new name # find a new name
counter = 1 counter = 1
while _node.name in cls._singleton._nodes: while _node.name in cls._singleton._launched_step_names:
_node.name = '{}_{}'.format(_node_name, counter) _node.name = '{}_{}'.format(_node_name, counter)
counter += 1 counter += 1
_node_name = _node.name _node_name = _node.name
cls._singleton._nodes[_node.name] = _node if _node.name not in cls._singleton._nodes:
cls._singleton._nodes[_node.name] = _node
# get node and park is as launched # get node and park is as launched
cls._singleton._launched_step_names.add(_node_name) cls._singleton._launched_step_names.add(_node_name)