From 783aae147b320704ad9d9d4e90503f2c74e0a1d9 Mon Sep 17 00:00:00 2001 From: Madhur Tandon Date: Tue, 17 Dec 2024 00:12:40 +0530 Subject: [PATCH] fail early without needing to reduce file_read_timeout --- metaflow/runner/utils.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/metaflow/runner/utils.py b/metaflow/runner/utils.py index 72a1e565fed..d77e94dfbd2 100644 --- a/metaflow/runner/utils.py +++ b/metaflow/runner/utils.py @@ -111,6 +111,11 @@ def read_from_fifo_when_ready( poll.register(fifo_fd, select.POLLIN) max_timeout = 3 # Wait for 10 * 3 = 30 ms after last write while True: + if check_process_exited(command_obj) and command_obj.process.returncode != 0: + raise CalledProcessError( + command_obj.process.returncode, command_obj.command + ) + if timeout < 0: raise TimeoutError("Timeout while waiting for the file content")