fix(ci): drop stale Gradle journal locks on the shared /gradle volume
All checks were successful
android-ci / android (pull_request) Successful in 11m30s

android-ci failed LockTimeoutException on /gradle/caches/journal-1: two
JVMs (PIDs a few apart) sharing onionwire-android-gradle. A cancelled job
never docker-rms the build container, so the next run mounts the same
volume while the previous Gradle still holds the lock. Also
org.gradle.parallel=true in android/gradle.properties.

Remove leftover onionwire-android-* containers (and trap EXIT), delete
stale *.lock files inside the container, and force parallel=false.
This commit is contained in:
agent 2026-09-18 22:02:22 -04:00
commit 9a1f50eadf
No known key found for this signature in database
2 changed files with 20 additions and 2 deletions

View file

@ -271,6 +271,8 @@ jobs:
rustc --version
cargo ndk --version
du -sh /opt/android-sdk /cargo /cargo-target /gradle || true
find /gradle -name '*.lock' -type f -delete 2>/dev/null || true
export GRADLE_OPTS="${GRADLE_OPTS:-} -Dorg.gradle.parallel=false -Dorg.gradle.daemon=false"
scripts/build-android-local.sh "$ONIONWIRE_VERSION"
version="$ONIONWIRE_VERSION"
abi="${ONIONWIRE_ANDROID_ABI:-arm64-v8a}"
@ -297,6 +299,10 @@ jobs:
docker volume create "$CARGO_VOLUME" >/dev/null
docker volume create "$TARGET_VOLUME" >/dev/null
docker volume create "$GRADLE_VOLUME" >/dev/null
# Same shared GRADLE_VOLUME as android-ci.yml. A cancelled job leaves
# the build container running and journal-1.lock held.
trap 'docker rm -f "$BUILD_CONTAINER" >/dev/null 2>&1 || true' EXIT
docker ps -aq --filter name=onionwire-android- | xargs -r docker rm -f || true
docker rm -f "$BUILD_CONTAINER" >/dev/null 2>&1 || true
docker pull "$ANDROID_IMAGE"
# 2 GB of Gradle heap, not 1: the only budget in this build that is close
@ -321,7 +327,7 @@ jobs:
-e ONIONWIRE_VERSION="$VERSION" \
-e RUST_TOOLCHAIN="$RUST_TOOLCHAIN" \
-e ANDROID_CMDLINE_TOOLS_URL="$ANDROID_CMDLINE_TOOLS_URL" \
-e GRADLE_OPTS="-Dorg.gradle.daemon=false -Dorg.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m -Dfile.encoding=UTF-8" \
-e GRADLE_OPTS="-Dorg.gradle.daemon=false -Dorg.gradle.parallel=false -Dorg.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m -Dfile.encoding=UTF-8" \
-v "$SDK_VOLUME":/opt/android-sdk \
-v "$CARGO_VOLUME":/cargo \
-v "$TARGET_VOLUME":/cargo-target \