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

zhengruifeng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/master by this push:
     new d404928b20cf [SPARK-61433][INFRA] Add missing timeouts to scheduled 
GitHub Actions jobs
d404928b20cf is described below

commit d404928b20cfbd785a5fd443e199589edbff9f98
Author: Ruifeng Zheng <[email protected]>
AuthorDate: Fri Nov 13 08:30:26 2026 +0800

    [SPARK-61433][INFRA] Add missing timeouts to scheduled GitHub Actions jobs
    
    ### What changes were proposed in this pull request?
    
    Add explicit timeouts to 20 jobs reached by scheduled workflows: Maven and 
hosted Python precompilation/test jobs; shared precondition, base-image and buf 
jobs; image-cache refresh; documentation preview; release validation; snapshot 
publication; the six branch schedulers; stale handling; build-status updates; 
and PR labeling.
    
    - Give Maven and hosted Python precompilation a configurable 90-minute 
limit.
    - Bound Maven shards at 150 minutes by default, 180 on ARM, and 360 on 
macOS. Bound hosted Python shards at 120 minutes, with a caller input for 
slower configurations.
    - Allow 120 minutes for the shared base-image job and 180 for refreshing 
the complete image cache.
    - Apply the 180-minute release limit in `apache/spark` and preserve 360 
minutes for real RC/finalize runs in forks.
    - Use the existing 120-minute documentation and 150-minute JVM build/test 
limits for documentation preview and snapshot publication. Bound short checks 
and maintenance jobs at 10 minutes.
    - Upload Maven unit-test logs on cancellation as well as failure, matching 
`!success()` in `build_and_test.yml`.
    
    The compilation fallback was removed in #60328, which has merged into 
master. Matrix jobs now use their configured timeout directly; no conditional 
six-hour fallback allowance or artifact-readiness output is needed.
    
    ### Why are the changes needed?
    
    ASF Infrastructure has asked Spark to reduce consumption of shared 
GitHub-hosted runners. Several scheduled jobs currently rely on GitHub Actions' 
default six-hour timeout. Explicit limits release runner capacity sooner when 
jobs hang or run unusually long, while retaining headroom for expensive 
configurations.
    
    Recent completed ARM Maven workflows have successful shards up to 132.7 
minutes, even when the workflow fails overall. A [successful macOS Maven 
shard](https://github.com/apache/spark/actions/runs/42099374394) took 292.9 
minutes, and precompilation took up to 60.9 minutes in the completed-run 
sample. These observations justify the ARM/macOS overrides and the higher 
precompile limit.
    
    Cold rebuilds of the complete image cache took 
[63.3](https://github.com/apache/spark/actions/runs/39779141323), 
[73.5](https://github.com/apache/spark/actions/runs/40426201049), 
[76.9](https://github.com/apache/spark/actions/runs/41081300876), and [125.3 
minutes](https://github.com/apache/spark/actions/runs/40551516291). The 
documented roughly 50-minute cold-cache figure applies to a PR build's 
base-image subset, not the complete cache refresh. The shared base-image job 
gets 120 minu [...]
    
    The 180-minute release limit is based on dry runs approaching 150 minutes. 
Fork release runs retain the previous limit because real RC/finalize work can 
include publishing artifacts and other operations absent from dry runs.
    
    Sampled up to the latest 10 successful `master` workflow runs on 
2026-11-11, plus the latest 10 completed `master` runs for ARM/macOS Maven and 
macOS Python. The latter includes successful jobs from otherwise failed runs. 
Averages exclude failed/cancelled jobs and queue time; each matrix shard is an 
observation. Some platform samples are older and predate recent precompilation 
changes. The four cold cache builds are reported separately from the scheduled 
sample.
    
    | Job group | Samples | Average (min) | Maximum (min) | Timeout (min) |
    |---|---:|---:|---:|---:|
    | Maven precompilation, all platforms | 42 | 47.8 | 81.1 | 90, configurable 
|
    | Hosted Python precompilation, ARM/macOS | 23 | 28.6 | 56.1 | 90, 
configurable |
    | Maven test shards, Linux x86 | 120 | 54.5 | 126.0 | 150 |
    | Maven test shards, Linux ARM | 228 | 54.1 | 139.0 | 180 |
    | Maven test shards, macOS | 201 | 97.4 | 292.9 | 360 |
    | Hosted Python test shards, Linux ARM | 99 | 46.5 | 75.5 | 120 |
    | Hosted Python test shards, macOS | 127 | 52.6 | 84.6 | 120 |
    | Base image build, cached | 10 | 6.2 | 25.4 | 120 |
    | Image cache refresh, scheduled sample | 10 | 10.5 | 43.8 | 180 |
    | Image cache refresh, four cited cold builds | 4 | 84.7 | 125.3 | 180 |
    | Documentation preview | 10 | 17.6 | 21.1 | 120 |
    | Release dry run | 10 | 116.1 | 149.9 | 180 ASF / 360 forks |
    | Snapshot publication shards | 70 | 51.4 | 88.0 | 150 |
    | Labeler, latest three successful jobs | 3 | 1.4 | 1.5 | 10 |
    | Precondition, buf, branch schedulers, stale, build status | 100 | 0.6 | 
3.8 | 10 |
    
    ### Does this PR introduce _any_ user-facing change?
    
    No.
    
    ### How was this patch tested?
    
    - Validated all 18 changed workflows with actionlint 1.7.12, disabling 
optional shellcheck/pyflakes checks and ignoring only the existing upstream 
`concurrency.queue` key unsupported by that version.
    - Compared parsed YAML against current master to verify the patch only adds 
timeout configuration, caller overrides, and cancellation-aware Maven log 
uploads.
    - Verified all runner jobs reached through local scheduled workflow calls 
have explicit timeouts, and both reusable test workflows require successful 
precompilation and use their configured timeout directly.
    - Retained the sampled averages/maxima above and checked the labeler's 
latest three successful jobs: average 1.42 minutes, maximum 1.48 minutes, 
versus its 10-minute limit.
    - Ran `git diff --check` and checked added lines for ASCII.
    
    No Spark runtime tests or manually dispatched workflows were run for these 
configuration changes. Push CI will run on the updated branch.
    
    ### Was this patch authored or co-authored using generative AI tooling?
    
    Generated-by: OpenAI Codex CLI 0.167.0 (GPT-6)
    
    Closes #60318 from zhengruifeng/add-ci-job-timeouts.
    
    Authored-by: Ruifeng Zheng <[email protected]>
    Signed-off-by: Ruifeng Zheng <[email protected]>
    
    
    skip-checks: true
---
 .github/workflows/branch35_scheduler.yml         |  1 +
 .github/workflows/branch40_scheduler.yml         |  1 +
 .github/workflows/branch41_scheduler.yml         |  1 +
 .github/workflows/branch42_scheduler.yml         |  1 +
 .github/workflows/branch43_scheduler.yml         |  1 +
 .github/workflows/branch4x_scheduler.yml         |  1 +
 .github/workflows/build_and_test.yml             |  3 +++
 .github/workflows/build_infra_images_cache.yml   |  1 +
 .github/workflows/build_maven_java21_arm.yml     |  1 +
 .github/workflows/build_maven_java21_macos26.yml |  2 ++
 .github/workflows/labeler.yml                    |  1 +
 .github/workflows/maven_test.yml                 | 14 +++++++++++++-
 .github/workflows/pages.yml                      |  1 +
 .github/workflows/publish_snapshot.yml           |  1 +
 .github/workflows/python_hosted_runner_test.yml  | 12 ++++++++++++
 .github/workflows/release.yml                    |  1 +
 .github/workflows/stale.yml                      |  1 +
 .github/workflows/update_build_status.yml        |  1 +
 18 files changed, 44 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/branch35_scheduler.yml 
b/.github/workflows/branch35_scheduler.yml
index 27459845a6e4..4a55057c1011 100644
--- a/.github/workflows/branch35_scheduler.yml
+++ b/.github/workflows/branch35_scheduler.yml
@@ -39,6 +39,7 @@ jobs:
   schedule:
     if: github.repository == 'apache/spark'
     runs-on: ubuntu-latest
+    timeout-minutes: 10
     env:
       GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
       SCALA213_CRON: *scala213_cron
diff --git a/.github/workflows/branch40_scheduler.yml 
b/.github/workflows/branch40_scheduler.yml
index 9355ee8b784f..c03eb29fee07 100644
--- a/.github/workflows/branch40_scheduler.yml
+++ b/.github/workflows/branch40_scheduler.yml
@@ -49,6 +49,7 @@ jobs:
   schedule:
     if: github.repository == 'apache/spark'
     runs-on: ubuntu-latest
+    timeout-minutes: 10
     env:
       GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
       MAVEN_CRON: *maven_cron
diff --git a/.github/workflows/branch41_scheduler.yml 
b/.github/workflows/branch41_scheduler.yml
index d7fd8938d0e9..73fd897af754 100644
--- a/.github/workflows/branch41_scheduler.yml
+++ b/.github/workflows/branch41_scheduler.yml
@@ -51,6 +51,7 @@ jobs:
   schedule:
     if: github.repository == 'apache/spark'
     runs-on: ubuntu-latest
+    timeout-minutes: 10
     env:
       GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
       MAVEN_CRON: *maven_cron
diff --git a/.github/workflows/branch42_scheduler.yml 
b/.github/workflows/branch42_scheduler.yml
index 8ca6a229423d..24334b12aaaa 100644
--- a/.github/workflows/branch42_scheduler.yml
+++ b/.github/workflows/branch42_scheduler.yml
@@ -51,6 +51,7 @@ jobs:
   schedule:
     if: github.repository == 'apache/spark'
     runs-on: ubuntu-latest
+    timeout-minutes: 10
     env:
       GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
       MAVEN_CRON: *maven_cron
diff --git a/.github/workflows/branch43_scheduler.yml 
b/.github/workflows/branch43_scheduler.yml
index e8db22c0b57a..bb575ce118f4 100644
--- a/.github/workflows/branch43_scheduler.yml
+++ b/.github/workflows/branch43_scheduler.yml
@@ -51,6 +51,7 @@ jobs:
   schedule:
     if: github.repository == 'apache/spark'
     runs-on: ubuntu-latest
+    timeout-minutes: 10
     env:
       GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
       MAVEN_CRON: *maven_cron
diff --git a/.github/workflows/branch4x_scheduler.yml 
b/.github/workflows/branch4x_scheduler.yml
index 5e6db6469964..c73232c0f35d 100644
--- a/.github/workflows/branch4x_scheduler.yml
+++ b/.github/workflows/branch4x_scheduler.yml
@@ -51,6 +51,7 @@ jobs:
   schedule:
     if: github.repository == 'apache/spark'
     runs-on: ubuntu-latest
+    timeout-minutes: 10
     env:
       GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
       MAVEN_CRON: *maven_cron
diff --git a/.github/workflows/build_and_test.yml 
b/.github/workflows/build_and_test.yml
index 106479f89c77..04f586314c99 100644
--- a/.github/workflows/build_and_test.yml
+++ b/.github/workflows/build_and_test.yml
@@ -81,6 +81,7 @@ jobs:
     # `ubuntu-slim` is lighter than `ubuntu-latest`.
     # Please see 
https://docs.github.com/en/actions/how-tos/write-workflows/choose-where-workflows-run/choose-the-runner-for-a-job#standard-github-hosted-runners-for-public-repositories
     runs-on: ubuntu-slim
+    timeout-minutes: 10
     env:
       GITHUB_PREV_SHA: ${{ github.event.before }}
     outputs:
@@ -441,6 +442,7 @@ jobs:
       fromJson(needs.precondition.outputs.required).docs == 'true' ||
       fromJson(needs.precondition.outputs.required).sparkr == 'true'
     runs-on: ubuntu-latest
+    timeout-minutes: 120
     permissions:
       packages: write
     steps:
@@ -819,6 +821,7 @@ jobs:
     if: (!cancelled()) && fromJson(needs.precondition.outputs.required).buf == 
'true'
     name: Protobuf breaking change detection and Python CodeGen check
     runs-on: ubuntu-latest
+    timeout-minutes: 10
     steps:
     - name: Bootstrap composite actions
       uses: actions/checkout@v7
diff --git a/.github/workflows/build_infra_images_cache.yml 
b/.github/workflows/build_infra_images_cache.yml
index 805fc6efb9f8..047e30c28e91 100644
--- a/.github/workflows/build_infra_images_cache.yml
+++ b/.github/workflows/build_infra_images_cache.yml
@@ -54,6 +54,7 @@ jobs:
   main:
     if: github.repository == 'apache/spark'
     runs-on: ubuntu-latest
+    timeout-minutes: 180
     permissions:
       packages: write
     steps:
diff --git a/.github/workflows/build_maven_java21_arm.yml 
b/.github/workflows/build_maven_java21_arm.yml
index 0dc29651691d..9b7430123da2 100644
--- a/.github/workflows/build_maven_java21_arm.yml
+++ b/.github/workflows/build_maven_java21_arm.yml
@@ -35,3 +35,4 @@ jobs:
       java: 21
       os: ubuntu-24.04-arm
       arch: arm64
+      build_timeout_minutes: 180
diff --git a/.github/workflows/build_maven_java21_macos26.yml 
b/.github/workflows/build_maven_java21_macos26.yml
index 91325251b5b4..aa96e3e24ee5 100644
--- a/.github/workflows/build_maven_java21_macos26.yml
+++ b/.github/workflows/build_maven_java21_macos26.yml
@@ -35,6 +35,8 @@ jobs:
       java: 21
       os: macos-26
       arch: arm64
+      # macOS Maven test shards can take close to five hours.
+      build_timeout_minutes: 360
       envs: >-
         {
           "SPARK_TEST_SQL_SHUFFLE_EXCHANGE_MAX_THREAD_THRESHOLD": "256",
diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml
index 563669071fca..acabf9cdc96b 100644
--- a/.github/workflows/labeler.yml
+++ b/.github/workflows/labeler.yml
@@ -47,6 +47,7 @@ jobs:
     name: Label pull requests
     if: github.repository == 'apache/spark' && github.ref == 
'refs/heads/master'
     runs-on: ubuntu-latest
+    timeout-minutes: 10
     permissions:
       actions: read
       contents: read
diff --git a/.github/workflows/maven_test.yml b/.github/workflows/maven_test.yml
index 124e7abc62a2..8200d5477f3d 100644
--- a/.github/workflows/maven_test.yml
+++ b/.github/workflows/maven_test.yml
@@ -46,6 +46,16 @@ on:
         required: false
         type: string
         default: x64
+      precompile_timeout_minutes:
+        description: Timeout for precompilation. Raise it for slower runners.
+        required: false
+        type: number
+        default: 90
+      build_timeout_minutes:
+        description: Timeout for each build matrix job. Raise it for slower 
runners.
+        required: false
+        type: number
+        default: 150
       envs:
         description: Additional environment variables to set when running the 
tests. Should be in JSON format.
         required: false
@@ -57,6 +67,7 @@ jobs:
   precompile-maven:
     name: "Precompile Spark with Maven"
     runs-on: ${{ inputs.os }}
+    timeout-minutes: ${{ inputs.precompile_timeout_minutes }}
     outputs:
       # Pinned so the build job checks out the same snapshot, even if the 
branch advances mid-run.
       head_sha: ${{ steps.checkout.outputs.head_sha }}
@@ -116,6 +127,7 @@ jobs:
     name: "Build modules: ${{ matrix.modules }} ${{ matrix.comment }}"
     needs: precompile-maven
     runs-on: ${{ inputs.os }}
+    timeout-minutes: ${{ inputs.build_timeout_minutes }}
     strategy:
       fail-fast: false
       max-parallel: 20
@@ -289,7 +301,7 @@ jobs:
             **/target/test-reports/*.xml
             **/target/surefire-reports/*.xml
       - name: Upload unit tests log files
-        if: failure()
+        if: ${{ !success() }}
         uses: actions/upload-artifact@v7
         with:
           name: unit-tests-log-${{ matrix.modules }}-${{ matrix.comment }}-${{ 
matrix.java }}-${{ matrix.hadoop }}-${{ matrix.hive }}
diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml
index d68515241442..a495568716b9 100644
--- a/.github/workflows/pages.yml
+++ b/.github/workflows/pages.yml
@@ -34,6 +34,7 @@ jobs:
   docs:
     name: Build and deploy documentation
     runs-on: ubuntu-latest
+    timeout-minutes: 120
     permissions:
       id-token: write
       pages: write
diff --git a/.github/workflows/publish_snapshot.yml 
b/.github/workflows/publish_snapshot.yml
index 1808f8da0aa8..8eea15939000 100644
--- a/.github/workflows/publish_snapshot.yml
+++ b/.github/workflows/publish_snapshot.yml
@@ -34,6 +34,7 @@ jobs:
   publish-snapshot:
     if: github.repository == 'apache/spark'
     runs-on: ubuntu-latest
+    timeout-minutes: 150
     strategy:
       fail-fast: false
       max-parallel: 20
diff --git a/.github/workflows/python_hosted_runner_test.yml 
b/.github/workflows/python_hosted_runner_test.yml
index 123e6df6df9c..024715b1e9b6 100644
--- a/.github/workflows/python_hosted_runner_test.yml
+++ b/.github/workflows/python_hosted_runner_test.yml
@@ -50,6 +50,16 @@ on:
         required: false
         type: string
         default: arm64
+      precompile_timeout_minutes:
+        description: Timeout for precompilation. Raise it for slower runners.
+        required: false
+        type: number
+        default: 90
+      build_timeout_minutes:
+        description: Timeout for each build matrix job. Raise it for slower 
runners.
+        required: false
+        type: number
+        default: 120
       envs:
         description: Additional environment variables to set when running the 
tests. Should be in JSON format.
         required: false
@@ -61,6 +71,7 @@ jobs:
   precompile:
     name: "Precompile Spark"
     runs-on: ${{ inputs.os }}
+    timeout-minutes: ${{ inputs.precompile_timeout_minutes }}
     outputs:
       # Pinned so the build job checks out the same snapshot, even if the 
branch advances mid-run.
       head_sha: ${{ steps.checkout.outputs.head_sha }}
@@ -106,6 +117,7 @@ jobs:
     name: "Build modules: ${{ matrix.modules }}"
     needs: precompile
     runs-on: ${{ inputs.os }}
+    timeout-minutes: ${{ inputs.build_timeout_minutes }}
     strategy:
       fail-fast: false
       max-parallel: 20
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 73eb92da0b5f..7a6395bdb4b6 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -96,6 +96,7 @@ jobs:
   release:
     name: Release Apache Spark
     runs-on: ubuntu-latest
+    timeout-minutes: ${{ github.repository == 'apache/spark' && 180 || 360 }}
     # Allow workflow to run only in the following cases:
     # 1. In the apache/spark repository:
     #    - Only allow dry runs (i.e., both 'branch' and 'release-version' 
inputs are empty).
diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml
index e1cce8e0c49b..c7748a384f89 100644
--- a/.github/workflows/stale.yml
+++ b/.github/workflows/stale.yml
@@ -27,6 +27,7 @@ jobs:
   stale:
     if: github.repository == 'apache/spark'
     runs-on: ubuntu-latest
+    timeout-minutes: 10
     steps:
     - uses: actions/stale@v11
       with:
diff --git a/.github/workflows/update_build_status.yml 
b/.github/workflows/update_build_status.yml
index e23a263fef9a..3003fed30f35 100644
--- a/.github/workflows/update_build_status.yml
+++ b/.github/workflows/update_build_status.yml
@@ -51,6 +51,7 @@ jobs:
     name: Update
     if: github.repository == 'apache/spark'
     runs-on: ubuntu-slim
+    timeout-minutes: 10
     permissions:
       actions: read
       checks: write


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to