#65722 closed task (blessed) (fixed)
Retry transient Docker image pull failures in PHPUnit workflows
| Reported by: | lancewillett | Owned by: | lancewillett |
|---|---|---|---|
| Priority: | normal | Milestone: | 7.1 |
| Component: | Build/Test Tools | Version: | |
| Severity: | normal | Keywords: | has-patch fixed-major |
| Cc: | Focuses: |
Description
The reusable PHPUnit workflow starts its Docker environment through npm run env:start. Docker Compose pulls the required images during that step.
Problem
A transient Docker Hub connection timeout currently aborts the job immediately. Reported errors include:
Client.Timeout exceeded while awaiting headers context deadline exceeded
The affected image varies, indicating a registry or network failure rather than an image-specific problem. A large matrix increases the chance that one failed pull fails the run.
Proposed change
Add an explicit image-pull step immediately before environment startup.
The step:
- Pulls
wordpress-develop,php,mysql, andcli. - Adds
memcachedonly when enabled. - Makes at most three pull attempts.
- Waits 10 seconds after the first failure and 20 seconds after the second.
- Reports the error and exits after the third failure.
Successfully pulled images remain locally cached for env:start.
Verification
A real Docker Hub timeout cannot be triggered reliably.
Verification completed:
- Simulated a failed first attempt followed by a successful real pull.
- Confirmed three simulated failures stopped after exactly three attempts.
- Confirmed
memcachedwas included only when enabled. - Started a PHP 8.4 and MySQL 8.4 environment using the cached images.
- Completed
npm run env:install. - Passed
actionlintand workflow whitespace checks.
Possible follow-up
Docker Hub authentication could provide stronger protection and higher pull limits. That requires repository credentials and should be considered separately.
Change History (11)
This ticket was mentioned in PR #12703 on WordPress/wordpress-develop by @lancewillett.
7 weeks ago
#1
- Keywords has-patch added
This ticket was mentioned in PR #12937 on WordPress/wordpress-develop by @desrosj.
5 weeks ago
#4
This moves the retry mechanism added in r62857 from the GitHub Actions workflow to the env:pull command, which is a benefit any time the command is run, not just in the PHPUnit workflow.
Trac ticket: Core-65722
## Use of AI Tools
Claude Code created the initial draft of this PR.
#5
@
5 weeks ago
- Keywords fixed-major added
- Resolution fixed
- Status closed → reopened
I'm reopening this to consider my PR with a suggestion to improve this.
Also, I think we should consider backporting this. In the past, it's been quite difficult and time consuming to maintain old branches because the state of the tooling was drastically different in multiple branches. We should try to keep everything in a consistent state as much as possible back through 4.7.
To make this easier and not require individual backport commits for every branch, we've been grouping changes into a single commit after backporting to the current maintained numbered branch, similar to the process the Security Team has been following.
#7
@
5 weeks ago
- Resolution fixed
- Status closed → reopened
Reopening for deep backporting consideration.
#8
@
4 weeks ago
The 7.1 dry run will start in about 16 hours. As this PR concerns the development environment, it should not be a blocker for the dry run.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
## Summary
This pre-pulls the Docker images used by the reusable PHPUnit workflow before
env:start.The pull retries at most three times, waiting 10 seconds after the first failure and 20 seconds after the second.
The service list matches the existing Compose context. It pulls
wordpress-develop,php,mysql, andcli, addingmemcachedonly when enabled.## Why
Transient Docker Hub connection timeouts currently fail the affected matrix job immediately. The affected image varies, indicating a registry or network failure rather than an image-specific
problem.
Successfully pulled images remain cached for environment startup.
The real timeout is nondeterministic and was not reproduced.
## Testing
actionlintand workflow whitespace checks.memcachedwas included only when enabled.npm run env:install.## Possible follow-up
Docker Hub authentication could provide stronger protection and higher pull limits. That requires repository credentials and should be considered separately.