dongjoon-hyun commented on code in PR #60318:
URL: https://github.com/apache/spark/pull/60318#discussion_r4534151082
##########
.github/workflows/release.yml:
##########
@@ -96,6 +96,7 @@ jobs:
release:
name: Release Apache Spark
runs-on: ubuntu-latest
+ timeout-minutes: 180
Review Comment:
This also applies to the real RC and `finalize` runs which release managers
dispatch from their forks, but the 149.9-minute maximum comes from
`apache/spark` dry runs only. A dry run (`-n`, `SKIP_TAG=1`) skips the tag
push, the Nexus upload (`xargs -P 4` with `curl --retry 10`), and `svn ci` for
bin/docs, so a real RC takes longer than a dry run.
If a real RC hits 180 minutes in the middle of `publish-release`, the RC tag
is already pushed while the staging repository and the SVN artifacts are only
partially uploaded, so the release manager has to do the manual cleanup
described at the top of this file. A timeout in `finalize` cannot be rolled
back at all.
Since `apache/spark` allows only dry runs (see the `if` below) and fork runs
don't use the ASF runner capacity, how about applying 180 minutes to
`apache/spark` only?
```suggestion
timeout-minutes: ${{ github.repository == 'apache/spark' && 180 || 360 }}
```
##########
.github/workflows/build_infra_images_cache.yml:
##########
@@ -54,6 +54,7 @@ jobs:
main:
if: github.repository == 'apache/spark'
runs-on: ubuntu-latest
+ timeout-minutes: 60
Review Comment:
The 10 samples (max 43.8 min) look like warm-cache scheduled runs. This
workflow is also triggered by `push` (Dockerfile or `pyproject.toml` changes;
11 of the 12 Dockerfiles copy `pyproject.toml`) and by `create` (new branches
and tags, which have no `cache-from` image yet). Those cold rebuilds take much
longer. For example, the `main` job took:
- 63 min: push to `branch-4.x`
(https://github.com/apache/spark/actions/runs/39779141323)
- 73 min: `v4.3.0-rc3` creation
(https://github.com/apache/spark/actions/runs/40426201049)
- 76 min: `v4.3.0` creation
(https://github.com/apache/spark/actions/runs/41081300876)
- 125 min: `v4.2.1` creation
(https://github.com/apache/spark/actions/runs/40551516291)
With a 60-minute job limit, such a run is killed in the middle and the
remaining images never update their `cache-to`. This defeats the per-step
`continue-on-error`, and the following PR builds have to build those images
from scratch (the ~50 minutes mentioned at the top of this file), which is the
opposite of the goal. Could we use step-level `timeout-minutes` on each `Build
and push` step instead, or a job limit which covers a full cold rebuild?
##########
.github/workflows/maven_test.yml:
##########
@@ -120,6 +126,7 @@ jobs:
needs: precompile-maven
if: (!cancelled())
runs-on: ${{ inputs.os }}
+ timeout-minutes: ${{ inputs.build_timeout_minutes }}
Review Comment:
When this timeout is hit, the job is cancelled, so `Upload unit tests log
files` (L323, `if: failure()`) is skipped and we lose
`**/target/unit-tests.log`, which is what we need to investigate the timeout.
`build_and_test.yml` fixed the same issue in SPARK-45037 (`Upload unit tests
log files for timeouted cancel`) by using `!success()`. Could you update L323
together in this PR?
```yaml
- name: Upload unit tests log files
if: ${{ !success() }}
```
##########
.github/workflows/maven_test.yml:
##########
@@ -58,6 +63,7 @@ jobs:
precompile-maven:
name: "Precompile Spark with Maven"
runs-on: ${{ inputs.os }}
+ timeout-minutes: 60
Review Comment:
The observed maximum (55.2 min) comes from macOS
(https://github.com/apache/spark/actions/runs/30487977375), so this leaves only
~8% headroom. Because of `continue-on-error: true`, a precompile timeout is
silent, and all 12 shards fall back to a local `mvn clean install`, which takes
about as long as the precompile itself (31-55 min in recent runs). Added to the
slow shards (x86 up to 126 min, ARM up to 139 min), this can exceed the
150-minute limit. So a slow but successful run before this PR becomes a hard
failure, and it consumes more runner time (12 full builds) rather than less.
Could we give the precompile more headroom (e.g. 90 minutes)?
##########
.github/workflows/maven_test.yml:
##########
@@ -46,6 +46,11 @@ on:
required: false
type: string
default: x64
+ build_timeout_minutes:
Review Comment:
`build_timeout_minutes` only covers the `build` job, while
`precompile-maven` stays at a hard-coded 60 minutes. macOS is the slowest
platform, which is why `build_maven_java21_macos26.yml` overrides the build
timeout to 300. However, the observed 55.2-minute precompile maximum also comes
from macOS (55, 52, and 42 min in the latest three successful runs), and the
caller cannot raise it. `python_hosted_runner_test.yml` (L65) has the same
issue for the macOS precompile. Could we add a matching input for the
precompile timeout as well?
##########
.github/workflows/python_hosted_runner_test.yml:
##########
@@ -110,6 +111,7 @@ jobs:
needs: precompile
if: (!cancelled())
runs-on: ${{ inputs.os }}
+ timeout-minutes: 120
Review Comment:
Similar to `maven_test.yml`, 120 minutes is based on shards which reuse the
precompiled artifact. If `precompile` (L65, 60 min, observed max 52.3 min)
fails or times out, each shard falls back to the local SBT build in
`dev/run-tests`, which takes about as long as the precompile, before running
the tests (macOS up to 84.6 min). The slower macOS shards can then exceed 120
minutes.
##########
.github/workflows/build_and_test.yml:
##########
@@ -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: 60
Review Comment:
This job is a dependency of `pyspark`, `sparkr`, `lint`, and `docs` (without
`!cancelled()`), and it runs in every fork PR build, not only in scheduled
builds. According to the comment in `build_infra_images_cache.yml`, a
cold-cache build of these images takes ~50 minutes, so 60 minutes leaves little
headroom. A PR which touches `pyproject.toml` or
`dev/spark-test-image/*/Dockerfile` (or which runs while the cache is stale)
would fail this job and skip all Python, R, lint, and docs jobs. The
25.4-minute maximum is from warm-cache `master` runs only. Could we raise this
one (e.g. 120 minutes, like the other jobs in this file)?
##########
.github/workflows/maven_test.yml:
##########
@@ -46,6 +46,11 @@ on:
required: false
type: string
default: x64
+ build_timeout_minutes:
+ description: Timeout for each build matrix job. Raise it for slower
runners.
+ required: false
+ type: number
+ default: 150
Review Comment:
`build_maven_java21_arm.yml` inherits this default, but its observed maximum
is 139 min, which leaves only ~7% headroom. Also, the ARM workflow has had no
successful `master` run since 2026-09-01, so "the latest 10 successful runs"
doesn't cover the last two months. The recent runs (failed overall) still show
long shards, e.g. `sql#core - slow tests` took 132 min on 2026-11-05
(https://github.com/apache/spark/actions/runs/42052359317). Could we override
`build_timeout_minutes` for ARM as well (e.g. 180), like macOS?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]