This is an automated email from the ASF dual-hosted git repository.

Aias00 pushed a commit to branch fix/k8s-ingress-healthcheck-flake
in repository https://gitbox.apache.org/repos/asf/shenyu.git

commit e87684a4a4d6ce1c791c36a12abe7a5a46725a64
Author: liuhy <[email protected]>
AuthorDate: Mon Jun 8 14:35:06 2026 +0800

    Retry transient CI dependency downloads
    
    GitHub Actions runs failed before project code executed when Temurin JDK 
and k3s binaries returned transient 504/download errors. Add an in-repo 
setup-java retry wrapper for observed setup-java callers and retry k3s 
installation in the k8s examples workflow.
    
    Constraint: The failures happened before Maven or integration tests could 
run, so test-code changes cannot address them.
    
    Rejected: Only rerun failed jobs | leaves the same external download point 
fragile on the next PR run
    
    Confidence: medium
    
    Scope-risk: moderate
    
    Directive: Keep workflow download retries close to the failing external 
install step so real build/test failures remain visible.
    
    Tested: Ruby YAML parse for changed workflow/action files; git diff --check
    
    Not-tested: actionlint is not installed locally; full GitHub Actions 
validation requires PR runs
---
 .github/workflows/ci.yml                 |  2 +-
 .github/workflows/integrated-test.yml    |  2 +-
 .github/workflows/k8s-examples-http.yml  | 19 +++++++++-
 actions/setup-java-with-retry/action.yml | 63 ++++++++++++++++++++++++++++++++
 4 files changed, 82 insertions(+), 4 deletions(-)

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 0da28afeac..15acf77117 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -89,7 +89,7 @@ jobs:
           key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
           restore-keys: |
             ${{ runner.os }}-maven-
-      - uses: actions/setup-java@v4
+      - uses: ./actions/setup-java-with-retry
         if: steps.filter.outputs.code == 'true'
         with:
           java-version: ${{ matrix.java }}
diff --git a/.github/workflows/integrated-test.yml 
b/.github/workflows/integrated-test.yml
index c085934abd..3bcce36ba3 100644
--- a/.github/workflows/integrated-test.yml
+++ b/.github/workflows/integrated-test.yml
@@ -74,7 +74,7 @@ jobs:
               - '!NOTICE'
               - '!.github/ISSUE_TEMPLATE/**'
               - '!.github/PULL_REQUEST_TEMPLATE'
-      - uses: actions/setup-java@v4
+      - uses: ./actions/setup-java-with-retry
         if: steps.filter.outputs.integration == 'true'
         with:
           java-version: 17
diff --git a/.github/workflows/k8s-examples-http.yml 
b/.github/workflows/k8s-examples-http.yml
index b2b3e40732..d8803f57bc 100644
--- a/.github/workflows/k8s-examples-http.yml
+++ b/.github/workflows/k8s-examples-http.yml
@@ -60,13 +60,28 @@ jobs:
       - name: Install k8s
         if: steps.filter.outputs.k8s-examples == 'true'
         run: |
-          curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION=v1.29.6+k3s2 
K3S_KUBECONFIG_MODE=777 sh -
+          install_k3s() {
+            curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION=v1.29.6+k3s2 
K3S_KUBECONFIG_MODE=777 sh -
+          }
+
+          for attempt in 1 2 3; do
+            if install_k3s; then
+              break
+            fi
+            if [ "$attempt" = 3 ]; then
+              echo "k3s install failed after $attempt attempts"
+              exit 1
+            fi
+            echo "k3s install failed on attempt $attempt"
+            sleep $((attempt * 15))
+          done
+
           cat /etc/rancher/k3s/k3s.yaml
           mkdir -p ~/.kube
           cp /etc/rancher/k3s/k3s.yaml ~/.kube/config
       - name: Setup Java and Maven cache
         if: steps.filter.outputs.k8s-examples == 'true'
-        uses: actions/setup-java@v4
+        uses: ./actions/setup-java-with-retry
         with:
           java-version: 17
           distribution: "temurin"
diff --git a/actions/setup-java-with-retry/action.yml 
b/actions/setup-java-with-retry/action.yml
new file mode 100644
index 0000000000..68a4a2c24f
--- /dev/null
+++ b/actions/setup-java-with-retry/action.yml
@@ -0,0 +1,63 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+name: 'Setup Java With Retry'
+description: 'Retries actions/setup-java to reduce transient GitHub release 
download failures.'
+inputs:
+  java-version:
+    description: 'Java version to install.'
+    required: true
+  distribution:
+    description: 'Java distribution to install.'
+    required: false
+    default: 'temurin'
+  cache:
+    description: 'Package manager cache to use.'
+    required: false
+    default: ''
+  cache-dependency-path:
+    description: 'Dependency file path for cache key generation.'
+    required: false
+    default: ''
+runs:
+  using: 'composite'
+  steps:
+    - name: Setup Java attempt 1
+      id: setup-java-1
+      uses: actions/setup-java@v4
+      continue-on-error: true
+      with:
+        java-version: ${{ inputs.java-version }}
+        distribution: ${{ inputs.distribution }}
+        cache: ${{ inputs.cache }}
+        cache-dependency-path: ${{ inputs.cache-dependency-path }}
+    - name: Setup Java attempt 2
+      id: setup-java-2
+      if: steps.setup-java-1.outcome == 'failure'
+      uses: actions/setup-java@v4
+      continue-on-error: true
+      with:
+        java-version: ${{ inputs.java-version }}
+        distribution: ${{ inputs.distribution }}
+        cache: ${{ inputs.cache }}
+        cache-dependency-path: ${{ inputs.cache-dependency-path }}
+    - name: Setup Java attempt 3
+      if: steps.setup-java-1.outcome == 'failure' && 
steps.setup-java-2.outcome == 'failure'
+      uses: actions/setup-java@v4
+      with:
+        java-version: ${{ inputs.java-version }}
+        distribution: ${{ inputs.distribution }}
+        cache: ${{ inputs.cache }}
+        cache-dependency-path: ${{ inputs.cache-dependency-path }}

Reply via email to