From c293194d56cd6438714d791ced3bd774ca032c25 Mon Sep 17 00:00:00 2001 From: Rob Taylor Date: Wed, 25 Jun 2025 11:55:11 +0100 Subject: [PATCH] Handle ReadTimeout error in submit --- chipflow_lib/steps/silicon.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/chipflow_lib/steps/silicon.py b/chipflow_lib/steps/silicon.py index e4b11d13..213e3800 100644 --- a/chipflow_lib/steps/silicon.py +++ b/chipflow_lib/steps/silicon.py @@ -200,8 +200,8 @@ def network_err(e): except requests.ConnectionError as e: if type(e.__context__) is urllib3.exceptions.MaxRetryError: network_err(e) - except requests.ConnectTimeout as e: - network_err(e) + except requests.exceptions.ReadTimeout as e: + network_err(e) # Parse response body try: @@ -288,7 +288,7 @@ def _long_poll_stream(self, sp, network_err): sp.text = "💥 Failed connecting to ChipFlow Cloud." logger.debug(f"Error while streaming logs: {e}") break - except requests.RequestException as e: + except (requests.RequestException, requests.exceptions.ReadTimeout) as e: sp.text = "💥 Failed streaming build logs. Trying again!" logger.debug(f"Error while streaming logs: {e}") stream_event_counter +=1 @@ -320,6 +320,11 @@ def _stream_logs(self, sp, network_err): ) except (requests.ConnectTimeout, requests.ConnectionError, requests.ConnectTimeout) as e: network_err(e) + except requests.exceptions.ReadTimeout as e: + sp.text = "💥 Error connecting to ChipFlow Cloud. Trying again! " + fail_counter += 1 + logger.debug(f"Failed to fetch build status{fail_counter} times: {e}") + continue if status_resp.status_code != 200: sp.text = "💥 Error connecting to ChipFlow Cloud. Trying again! "