Skip to content

Build/Test Tools: Add a start period to the MySQL healthcheck on the 7.0 branch. - #12770

Closed
adimoldovan wants to merge 1 commit into
WordPress:7.0from
adimoldovan:65752-mysql-healthcheck-start-period-7.0
Closed

Build/Test Tools: Add a start period to the MySQL healthcheck on the 7.0 branch.#12770
adimoldovan wants to merge 1 commit into
WordPress:7.0from
adimoldovan:65752-mysql-healthcheck-start-period-7.0

Conversation

@adimoldovan

@adimoldovan adimoldovan commented Jul 30, 2026

Copy link
Copy Markdown

Backport of r62937 to the 7.0 branch. Developed in #12753.

The mysql healthcheck sets interval, timeout, and retries, but not start_period. Docker therefore counts the checks that run while the database initializes against the retry budget of interval × retries, which is 50 seconds.

The first start of a database volume creates the data directory and runs the files in /docker-entrypoint-initdb.d. On a loaded CI runner that work can take longer than 50 seconds. Docker then marks the container unhealthy, every service that declares mysql: condition: service_healthy fails to start, and docker compose up fails:

09:33:37  Container wordpress-develop-mysql-1  Started
09:33:37  Container wordpress-develop-mysql-1  Waiting
09:34:27  Container wordpress-develop-mysql-1  Error
          dependency failed to start: container wordpress-develop-mysql-1 is unhealthy

Example run: https://github.com/WordPress/wordpress-develop/actions/runs/30439797855/job/90536164263

This patch adds start_period: 60s.

Testing instructions

The failure needs a first start that takes more than 50 seconds. A fast machine initializes the volume in about 10 seconds, so the failure does not appear locally. Measure the margin instead:

npm run env:stop
docker compose down -v
docker compose up -d mysql
docker inspect --format '{{.State.Health.Status}}' $(docker compose ps -q mysql)

Repeat the inspect command and record how long the container stays starting. Compare that time to the 50 second budget.

Then confirm that the start period does not delay a healthy start: on this branch the container still reports healthy at the same point it did before, not 60 seconds later.

Trac ticket: https://core.trac.wordpress.org/ticket/65752


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

Without `start_period`, Docker counts the checks that run while the database
initializes against the retry budget of `interval` x `retries`, which is 50
seconds. A first start of a cold volume that takes longer than that marks the
container unhealthy, and every service that declares
`mysql: condition: service_healthy` fails to start.

A failed check inside the start period does not increment the failure streak,
and the first check that passes marks the container healthy at once, so this
does not slow down a normal start.

Merges [62937] to the 7.0 branch.

See #65752.
@github-actions

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props adrianmoldovanwp.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@adimoldovan adimoldovan self-assigned this Jul 30, 2026
@adimoldovan adimoldovan changed the title Build/Test Tools: Add a start period to the MySQL healthcheck (7.0 branch). Build/Test Tools: Add a start period to the MySQL healthcheck on the 7.0 branch. Jul 30, 2026
pento pushed a commit that referenced this pull request Jul 30, 2026
Merges [62937] to the 7.0 branch.

Developed in: #12770

Reviewed by: johnbillion.
Props adrianmoldovanwp.
See #65752.


git-svn-id: https://develop.svn.wordpress.org/branches/7.0@62946 602fd350-edb4-49c9-b593-d223f7449a82
@github-actions

Copy link
Copy Markdown

A commit was made that fixes the Trac ticket referenced in the description of this pull request.

SVN changeset: 62948
GitHub commit: 42ef1ae

This PR will be closed, but please confirm the accuracy of this and reopen if there is more work to be done.

@github-actions github-actions Bot closed this Jul 30, 2026
markjaquith pushed a commit to markjaquith/WordPress that referenced this pull request Jul 30, 2026
Merges [62937] to the 7.0 branch.

Developed in: WordPress/wordpress-develop#12770

Reviewed by: johnbillion.
Props adrianmoldovanwp.
See #65752.

Built from https://develop.svn.wordpress.org/branches/7.0@62946


git-svn-id: http://core.svn.wordpress.org/branches/7.0@62189 1a063a9b-81f0-0310-95a4-ce76da25c4cd
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.

3 participants