Skip to content

Fix MariaDB socket readiness race condition in ARM64 Docker builds#33

Draft
Copilot wants to merge 3 commits into
masterfrom
copilot/fix-failing-docker-matrix-job
Draft

Fix MariaDB socket readiness race condition in ARM64 Docker builds#33
Copilot wants to merge 3 commits into
masterfrom
copilot/fix-failing-docker-matrix-job

Conversation

Copilot AI commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

On linux/arm64 (QEMU), mysql_install_db takes ~44 minutes to complete. The subsequent sleep 4 before connecting was insufficient for MariaDB's socket to become available, causing all ARM64 builds to fail with ERROR 2002 (HY000): Can't connect to local server through socket '/run/mysqld/mysqld.sock'.

Changes

  • All Dockerfile.php*: Replace fixed sleep 4 with a poll loop that retries SELECT 1 every second until the socket is ready, with a 120-second hard timeout to prevent indefinite hangs on genuine failures.
# Before
RUN sh -c 'mysqld_safe --datadir=/var/lib/mysql &' && sleep 4 && mysql -u root -e "CREATE DATABASE wordpress"

# After
RUN sh -c 'mysqld_safe --datadir=/var/lib/mysql &' && i=0; until mysql -u root -e "SELECT 1" >/dev/null 2>&1; do sleep 1; i=$((i+1)); if [ "$i" -ge 120 ]; then exit 1; fi; done && mysql -u root -e "CREATE DATABASE wordpress"

Applied to all 7 Dockerfiles (php7.4 through php8.5).

Copilot AI changed the title [WIP] Fix failing GitHub Actions job docker-matrix (7.0, 8.4) Fix MariaDB socket readiness race condition in ARM64 Docker builds Jun 12, 2026
Copilot AI requested a review from kadamwhite June 12, 2026 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants