Skip to content

Commit 02dcf9d

Browse files
committed
Handle ReadTimeout error in submit
1 parent 570c246 commit 02dcf9d

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

chipflow_lib/steps/silicon.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,8 @@ def network_err(e):
200200
except requests.ConnectionError as e:
201201
if type(e.__context__) is urllib3.exceptions.MaxRetryError:
202202
network_err(e)
203-
except requests.ConnectTimeout as e:
204-
network_err(e)
203+
except requests.exceptions.ReadTimeout as e:
204+
network_err(e)
205205

206206
# Parse response body
207207
try:
@@ -288,7 +288,7 @@ def _long_poll_stream(self, sp, network_err):
288288
sp.text = "💥 Failed connecting to ChipFlow Cloud."
289289
logger.debug(f"Error while streaming logs: {e}")
290290
break
291-
except requests.RequestException as e:
291+
except (requests.RequestException, requests.exceptions.ReadTimeout) as e:
292292
sp.text = "💥 Failed streaming build logs. Trying again!"
293293
logger.debug(f"Error while streaming logs: {e}")
294294
stream_event_counter +=1
@@ -320,6 +320,11 @@ def _stream_logs(self, sp, network_err):
320320
)
321321
except (requests.ConnectTimeout, requests.ConnectionError, requests.ConnectTimeout) as e:
322322
network_err(e)
323+
except requests.exceptions.ReadTimeout as e:
324+
sp.text = "💥 Error connecting to ChipFlow Cloud. Trying again! "
325+
fail_counter += 1
326+
logger.debug(f"Failed to fetch build status{fail_counter} times: {e}")
327+
continue
323328

324329
if status_resp.status_code != 200:
325330
sp.text = "💥 Error connecting to ChipFlow Cloud. Trying again! "

0 commit comments

Comments
 (0)