comphead commented on code in PR #7828:
URL: https://github.com/apache/datafusion-comet/pull/7828#discussion_r4778320033
##########
.github/workflows/pr_build_linux.yml:
##########
@@ -786,9 +786,37 @@ jobs:
path: ./tpch
key: tpch-${{ hashFiles('.github/workflows/pr_build_linux.yml') }}
+ # Match the download-error retry in `lint-java`. In cache-refresh-only
+ # mode, the TPC-H and TPC-DS jobs are the only Maven builds, so a
+ # Maven Central hiccup here skips saving the Maven cache. Non-download
+ # failures (such as compile errors) still fail on the first attempt, and
+ # retries pass -U because Maven caches 404s in the local repository.
- name: Build project
+ # Bash rather than the container default `sh`: the retry below needs
+ # pipefail, $RANDOM, and shell arithmetic.
+ shell: bash
run: |
- ./mvnw -B -Prelease install -DskipTests
+ set -o pipefail
+ log=$(mktemp)
+ trap 'rm -f "$log"' EXIT
+ update=
+ for attempt in 1 2 3 4; do
+ if ./mvnw -B $update -Prelease install -DskipTests 2>&1 | tee
"$log"; then
+ exit 0
+ fi
+ if ! grep -qE '^\[(ERROR|FATAL)\] .*(No plugin found for
prefix|could not be resolved|Could not transfer|Could not find
artifact|ClassNotFoundException: scala\.tools\.nsc\.Main)' "$log"; then
+ echo "::error::Maven failed for a reason other than a download,
such as a compile error; not retrying."
+ exit 1
+ fi
+ if [ "$attempt" -eq 4 ]; then
+ echo "::error::Maven could not download a plugin or dependency
after $attempt attempts."
+ exit 1
+ fi
+ delay=$((10 * (1 << (attempt - 1)) + RANDOM % 5))
+ echo "::warning::Maven failed to download a plugin or dependency
(attempt $attempt of 4); retrying in ${delay}s with -U."
+ sleep "$delay"
+ update=-U
+ done
Review Comment:
This 20-line script now exists three times (`lint-java` near line 223, here,
and in `verify-benchmark-results-tpcds` near line 899), and the copies have
already drifted: the new ones also match `[FATAL]` and `Could not find
artifact`, `lint-java` does not. A single `dev/ci/mvn-retry.sh` taking the
Maven arguments (called as `dev/ci/mvn-retry.sh ./mvnw -B -Prelease install
-DskipTests`) would keep one regex and one backoff, remove the `shell: bash`
and comment boilerplate from every call site, and let `lint-java` adopt the
`FATAL` and `Could not find artifact` patterns too. These jobs already run
`actions/checkout`, so a script path resolves.
##########
.github/workflows/pr_build_linux.yml:
##########
@@ -786,9 +786,37 @@ jobs:
path: ./tpch
key: tpch-${{ hashFiles('.github/workflows/pr_build_linux.yml') }}
+ # Match the download-error retry in `lint-java`. In cache-refresh-only
+ # mode, the TPC-H and TPC-DS jobs are the only Maven builds, so a
+ # Maven Central hiccup here skips saving the Maven cache. Non-download
+ # failures (such as compile errors) still fail on the first attempt, and
+ # retries pass -U because Maven caches 404s in the local repository.
- name: Build project
+ # Bash rather than the container default `sh`: the retry below needs
+ # pipefail, $RANDOM, and shell arithmetic.
+ shell: bash
run: |
- ./mvnw -B -Prelease install -DskipTests
+ set -o pipefail
+ log=$(mktemp)
+ trap 'rm -f "$log"' EXIT
+ update=
+ for attempt in 1 2 3 4; do
+ if ./mvnw -B $update -Prelease install -DskipTests 2>&1 | tee
"$log"; then
+ exit 0
+ fi
+ if ! grep -qE '^\[(ERROR|FATAL)\] .*(No plugin found for
prefix|could not be resolved|Could not transfer|Could not find
artifact|ClassNotFoundException: scala\.tools\.nsc\.Main)' "$log"; then
+ echo "::error::Maven failed for a reason other than a download,
such as a compile error; not retrying."
+ exit 1
+ fi
+ if [ "$attempt" -eq 4 ]; then
+ echo "::error::Maven could not download a plugin or dependency
after $attempt attempts."
+ exit 1
+ fi
+ delay=$((10 * (1 << (attempt - 1)) + RANDOM % 5))
+ echo "::warning::Maven failed to download a plugin or dependency
(attempt $attempt of 4); retrying in ${delay}s with -U."
+ sleep "$delay"
+ update=-U
+ done
- name: Generate TPC-H data (SF=1)
Review Comment:
The step after the build, `Generate TPC-H data`, runs `../mvnw -B -Prelease
exec:java ...` (and `Generate TPC-DS data` does the same) with no retry.
`exec-maven-plugin` is declared in `spark/pom.xml` only inside the
`generate-docs` profile (line 638) and has no `pluginManagement` entry in the
root `pom.xml`, so `-Prelease install` does not resolve it. I expect
`exec:java` to do its own prefix lookup and plugin download, which is the `No
plugin found for prefix` failure this PR retries one step earlier. A failure
there also skips `Save Maven dependencies`, which is the problem the PR
describes. Please either route these steps through the same retry or show that
the build step already caches the plugin, for example from a cold-cache run.
--
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]