This is an automated email from the ASF dual-hosted git repository.
pingtimeout pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/polaris.git
The following commit(s) were added to refs/heads/main by this push:
new f0ede5795 Release workflows should retry svn checkout in case of
failure (#3393)
f0ede5795 is described below
commit f0ede57951810e1bac2812e4e6498d261e09d4d5
Author: Pierre Laporte <[email protected]>
AuthorDate: Mon Jan 12 16:04:58 2026 +0100
Release workflows should retry svn checkout in case of failure (#3393)
---
.../release-3-build-and-publish-artifacts.yml | 8 +++--
.github/workflows/release-4-publish-release.yml | 3 +-
releasey/libs/_exec.sh | 36 ++++++++++++++++++++++
3 files changed, 44 insertions(+), 3 deletions(-)
diff --git a/.github/workflows/release-3-build-and-publish-artifacts.yml
b/.github/workflows/release-3-build-and-publish-artifacts.yml
index 2daca55f2..34b054267 100644
--- a/.github/workflows/release-3-build-and-publish-artifacts.yml
+++ b/.github/workflows/release-3-build-and-publish-artifacts.yml
@@ -180,7 +180,9 @@ jobs:
source "${LIBS_DIR}/_exec.sh"
dist_dev_dir=${RELEASEY_DIR}/polaris-dist-dev
- exec_process svn checkout --username "$SVN_USERNAME" --password
"$SVN_PASSWORD" --non-interactive "${APACHE_DIST_URL}${APACHE_DIST_PATH}"
"${dist_dev_dir}"
+
+ # Retry logic for SVN checkout (Apache SVN can have transient
connectivity issues)
+ exec_process_with_retries 5 60 "${dist_dev_dir}" svn checkout
--username "$SVN_USERNAME" --password "$SVN_PASSWORD" --non-interactive
"${APACHE_DIST_URL}${APACHE_DIST_PATH}" "${dist_dev_dir}"
version_dir="${dist_dev_dir}/${version_without_rc}"
exec_process mkdir -p "${version_dir}"
@@ -386,7 +388,9 @@ jobs:
source "${LIBS_DIR}/_exec.sh"
dist_dev_dir=${RELEASEY_DIR}/polaris-dist-dev
- exec_process svn checkout --username "$SVN_USERNAME" --password
"$SVN_PASSWORD" --non-interactive "${APACHE_DIST_URL}${APACHE_DIST_PATH}"
"${dist_dev_dir}"
+
+ # Retry logic for SVN checkout (Apache SVN can have transient
connectivity issues)
+ exec_process_with_retries 5 60 "${dist_dev_dir}" svn checkout
--username "$SVN_USERNAME" --password "$SVN_PASSWORD" --non-interactive
"${APACHE_DIST_URL}${APACHE_DIST_PATH}" "${dist_dev_dir}"
exec_process mkdir -p
"${dist_dev_dir}/helm-chart/${version_without_rc}"
exec_process cp helm/polaris-${version_without_rc}.tgz*
"${dist_dev_dir}/helm-chart/${version_without_rc}/"
diff --git a/.github/workflows/release-4-publish-release.yml
b/.github/workflows/release-4-publish-release.yml
index 6048af104..b47d1e9f3 100644
--- a/.github/workflows/release-4-publish-release.yml
+++ b/.github/workflows/release-4-publish-release.yml
@@ -226,7 +226,8 @@ jobs:
release_helm_dir="${RELEASEY_DIR}/polaris-dist-release-helm-chart"
release_helm_url="${APACHE_DIST_URL}/release/incubator/polaris/helm-chart"
- exec_process svn checkout --username "$SVN_USERNAME" --password
"$SVN_PASSWORD" --non-interactive "${release_helm_url}" "${release_helm_dir}"
+ # Retry logic for SVN checkout (Apache SVN can have transient
connectivity issues)
+ exec_process_with_retries 5 60 "${release_helm_dir}" svn checkout
--username "$SVN_USERNAME" --password "$SVN_PASSWORD" --non-interactive
"${release_helm_url}" "${release_helm_dir}"
exec_process cd "${release_helm_dir}"
exec_process helm repo index .
diff --git a/releasey/libs/_exec.sh b/releasey/libs/_exec.sh
index ae83c3fad..3fd0e48b6 100644
--- a/releasey/libs/_exec.sh
+++ b/releasey/libs/_exec.sh
@@ -32,6 +32,42 @@ function exec_process {
fi
}
+# Executes a command with retry logic
+# Args:
+# $1: max_attempts - Maximum number of retry attempts
+# $2: sleep_duration - Seconds to wait between retries
+# $3: cleanup_path - Path to clean up before retrying (can be empty)
+# $@: Command and arguments to execute
+function exec_process_with_retries {
+ if [[ $# -lt 4 ]]; then
+ echo "ERROR: exec_process_with_retries requires: max_attempts
sleep_duration cleanup_path command [args...]"
+ exit 1
+ fi
+
+ local max_attempts="${1}"
+ local sleep_duration="${2}"
+ local cleanup_path="${3}"
+ shift 3
+
+ local attempt=1
+ while true; do
+ if exec_process "$@"; then
+ break
+ fi
+ if [[ $attempt -ge $max_attempts ]]; then
+ echo "ERROR: Command failed after ${max_attempts} attempts: ${*}"
+ exit 1
+ fi
+ echo "WARNING: Command failed (attempt ${attempt}/${max_attempts}),
retrying in ${sleep_duration} seconds..."
+ # Clean up any partial state before retrying
+ if [[ -n "${cleanup_path}" && -e "${cleanup_path}" ]]; then
+ rm -rf "${cleanup_path}"
+ fi
+ sleep "${sleep_duration}"
+ ((attempt++))
+ done
+}
+
function calculate_sha512 {
local source_file="$1"
local target_file="${source_file}.sha512"