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): ...@@ -222,9 +222,6 @@ class AlgorithmExecutor(object):
loop_channel=self.loop_channel, loop_channel=self.loop_channel,
) )
if not result:
return False
else: else:
if self.algorithm.type == Algorithm.LEGACY: if self.algorithm.type == Algorithm.LEGACY:
logger.warning( logger.warning(
...@@ -260,23 +257,22 @@ class AlgorithmExecutor(object): ...@@ -260,23 +257,22 @@ class AlgorithmExecutor(object):
output=self.output_list[0], output=self.output_list[0],
) )
else: else:
try: result = self.runner.process(
result = self.runner.process( inputs=self.input_list,
inputs=self.input_list, data_loaders=self.data_loaders,
data_loaders=self.data_loaders, outputs=self.output_list,
outputs=self.output_list, loop_channel=self.loop_channel,
loop_channel=self.loop_channel, )
except Exception:
result = None
if not result: if not result:
self.done({}) break
return False
for output in self.output_list: for output in self.output_list:
output.close() output.close()
if not result:
return False
missing_data_outputs = [x for x in self.output_list if x.isDataMissing()] missing_data_outputs = [x for x in self.output_list if x.isDataMissing()]
if missing_data_outputs: if missing_data_outputs:
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment