Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions utils/gcp_pubsub_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,16 +340,15 @@ def process_message(self, message: Any):
# Retry download once with fresh client if TransportError/SSL issues occur
success = False
for attempt in range(2):
try:
if download_from_gcs(gcs_uri, temp_path, logger=mlog, client=self.storage_client):
success = True
break
except Exception as e:
if download_from_gcs(gcs_uri, temp_path, logger=mlog, client=self.storage_client):
success = True
break
else:
if attempt == 0:
mlog.warning("Transient error during download, recreating client and retrying: %s", e)
mlog.warning("Transient error during download, recreating client and retrying")
self._init_clients()
else:
mlog.error("Persistent error during download: %s", e)
mlog.error("Persistent error during download after retries")

if success:
mlog.info("Download finished in %.2f seconds", time.time() - dl_start)
Expand Down
Loading