Commit d7207172 authored by Samuel GAIST's avatar Samuel GAIST

[execution][algorithm] Handle error the same way for all algorithm types

Currently sequential and autonomous algorithms are not treating
errors happening in the process method the same way. This result
in missing information coming back up through beat/beat.core>

This patch fixes this and also ensure that the outputs are
properly closed.

Fixes beat.core#98
parent a22c8063
Pipeline #40702 passed with stage
in 2 minutes and 57 seconds
......@@ -222,9 +222,6 @@ class AlgorithmExecutor(object):
loop_channel=self.loop_channel,
)
if not result:
return False
else:
if self.algorithm.type == Algorithm.LEGACY:
logger.warning(
......@@ -260,23 +257,22 @@ class AlgorithmExecutor(object):
output=self.output_list[0],
)
else:
try:
result = self.runner.process(
inputs=self.input_list,
data_loaders=self.data_loaders,
outputs=self.output_list,
loop_channel=self.loop_channel,
)
except Exception:
result = None
if not result:
self.done({})
return False
break
for output in self.output_list:
output.close()
if not result:
return False
missing_data_outputs = [x for x in self.output_list if x.isDataMissing()]
if missing_data_outputs:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment