Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ jobs:
set -euo pipefail
tag="$(echo '${{ steps.meta.outputs.tags }}' | head -1)"
docker run -d --name postgis-verify -e POSTGRES_PASSWORD=test "$tag"
# initdb runs a temporary server first; wait for the real one
until docker logs postgis-verify 2>&1 | grep -q 'PostgreSQL init process complete'; do sleep 1; done
until docker exec postgis-verify pg_isready -U postgres -q; do sleep 1; done
Comment on lines +93 to 94

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 bug · medium

Bound the container init-wait loops

The new wait loops at .github/workflows/docker.yml:93 and .github/workflows/docker.yml:121 are unbounded until ...; do sleep 1; done with no iteration cap, and the adjacent pg_isready loops at lines 94 and 122 are likewise unbounded. If the container fails to initialize (e.g. initdb error, bad POSTGRES_PASSWORD, OOM), the log never contains PostgreSQL init process complete, and since an until condition is exempt from set -e/pipefail, the step spins until the GitHub Actions job timeout (default 6 hours). This burns runner minutes and masks the real failure; on the push job it also delays manifest tagging of latest/18.

📋 Prompt for AI Agents

In .github/workflows/docker.yml at lines 93-94 and the duplicate at lines 121-122, replace the unbounded until ...; do sleep 1; done loops (both the docker logs | grep loop and the pg_isready loop) with bounded loops: keep an attempts counter incremented each sleep, and after ~120 attempts (2 minutes) exit 1 while printing docker logs postgis-verify so a failed container init fails the step instead of hanging until the 6-hour job timeout.

./scripts/verify-postgis-security.sh postgis-verify
./scripts/verify-postgres-security.sh postgis-verify
Expand All @@ -115,6 +117,8 @@ jobs:
set -euo pipefail
image="${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}@${{ steps.build.outputs.digest }}"
docker run -d --name postgis-verify -e POSTGRES_PASSWORD=test "$image"
# initdb runs a temporary server first; wait for the real one
until docker logs postgis-verify 2>&1 | grep -q 'PostgreSQL init process complete'; do sleep 1; done
until docker exec postgis-verify pg_isready -U postgres -q; do sleep 1; done
./scripts/verify-postgis-security.sh postgis-verify
./scripts/verify-postgres-security.sh postgis-verify
Expand Down
Loading