Skip to content

Commit 896231d

Browse files
committed
Improve retry logic
We are starting to see errors from GCS where the socket fails: ``` |-> ERROR: HTTPSConnectionPool(host='storage.googleapis.com', port=443): Max retries exceeded with url: /quic-ci-artifacts/qualcomm-linux/qualcomm-linux/meta-qcom/21286077511-2/qcom-distro/qcom-armv7a/qcom-multimedia-image-qcom-armv7a.rootfs-20260123181428.ext4?Expires=1769193637&GoogleAccessId=gh-runner-fileserver%40fio-jobserv-ci.iam.gserviceaccount.com&Signature=2q9R2tZlw8tvuXu0sbxDPl6Qzh3svbXNwSzzEwCu0AqUHhRh0s78aW4eJ96xMAuin2WZ9ey8Fm2dYTkS9E0LhAOOwohW3I9anKDMmxMev7svKEfAaAqNtcvyA%2F0Stow4BR8HRzJ9DhLOp8lhGj0%2F5qA6Y%2FTl5Fk5WXSgjFQ94%2Fju5ezr%2FtdqHPk8BoTGlbZz6acg%2B3m%2BREwilSTcETm%2BXpnMm5w%2F9PN3X6PrzbgezKMkLyQWvpd5zrH1d12cguurVmgU%2B0qKZ1TxQLU%2BQ91FrB0Kvx1NJwiPkFvNc6uADpjFmx%2F1xRMgwy9y7Gxwa24Yed9J82SbHMurWO83U9wVWg%3D%3D (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:2427)'))) ``` This change adds logic to catch connection errors and retry. Signed-off-by: Andy Doan <andy@foundries.io>
1 parent e070613 commit 896231d

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

publish_artifacts.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,20 @@ def upload_file(args):
4848
url = r.headers["location"]
4949
path = os.path.join(base, name)
5050
for x in (1, 2, 3, 0):
51-
r = requests.put(
52-
url,
53-
data=open(path, "rb"),
54-
headers={"Content-type": "application/octet-stream"},
55-
)
51+
try:
52+
r = requests.put(
53+
url,
54+
data=open(path, "rb"),
55+
headers={"Content-type": "application/octet-stream"},
56+
)
57+
except Exception as e:
58+
print(
59+
f"Unexpected error uploading {name}: {e}",
60+
flush=True,
61+
file=sys.stderr,
62+
)
63+
sleep(x)
64+
continue
5665
if not r.ok:
5766
if not x:
5867
return (

0 commit comments

Comments
 (0)