From 501fd48d69a0abf6d1de9ad93f4f3e0d31e03889 Mon Sep 17 00:00:00 2001 From: Julius Unverfehrt Date: Thu, 17 Aug 2023 13:26:19 +0200 Subject: [PATCH] Adjust error handling of processing sub-process Removes exception catching when collecting subprocess result which led to the service silently go over failing file processing. Now, the sub-process doesn't return any results if it failed. It is made sure that an empty result is still returned if no images were present on the file to process. --- image_prediction/utils/process_wrapping.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/image_prediction/utils/process_wrapping.py b/image_prediction/utils/process_wrapping.py index 516e40b..c26f48f 100644 --- a/image_prediction/utils/process_wrapping.py +++ b/image_prediction/utils/process_wrapping.py @@ -17,9 +17,6 @@ def wrap_in_process(fn): process = multiprocessing.Process(target=process_fn, args=args, kwargs=kwargs) process.start() process.join() - try: - return return_queue.pop(0) - except IndexError: - logger.warning("No results returned by subprocess.") + return return_queue.pop(0) return wrapped_fn