Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[rptest] Auto-retry in RedpandaInstaller._avail_for_download #24116

Merged
merged 1 commit into from
Dec 5, 2024
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: 12 additions & 1 deletion tests/rptest/services/redpanda_installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import typing
import threading
from datetime import datetime, timezone, timedelta
from time import sleep

import requests

Expand Down Expand Up @@ -447,7 +448,17 @@ def _avail_for_download(self, version: tuple[int, int, int]):
"""
r = requests.head(self._version_package_url(version))
# allow 403 ClientError, it usually indicates Unauthorized get and can happen on S3 while dealing with old releases
if r.status_code not in (200, 403, 404):
allowed = (200, 403, 404)
if r.status_code not in allowed:
num_retries = 3
while num_retries > 0:
sleep(5.0**(4 - num_retries))
r = requests.head(self._version_package_url(version))
if r.status_code in allowed:
break
num_retries -= 1

if r.status_code not in allowed:
r.raise_for_status()

if r.status_code == 403:
Expand Down