Skip to content

Reset shared image cache on docker pull failure#228

Open
aduth wants to merge 4 commits intomasterfrom
fix/dserve-pull-error
Open

Reset shared image cache on docker pull failure#228
aduth wants to merge 4 commits intomasterfrom
fix/dserve-pull-error

Conversation

@aduth
Copy link
Member

@aduth aduth commented Jun 3, 2025

Fixes the issue identified at Automattic/wp-calypso#103848 (comment)

The pullImage function uses internal state to ensure that multiple concurrent pulls are only executed a single time.

After a pull succeeds or fails via some docker pull progress result, the state value is released so that future pulls can try again (source). However, if the docker pull fails before it gets to progress updates (e.g. "Not found"), the state value is never released, and subsequent pull attempts will always fail, even if the image would eventually become available, such as the situation described in Automattic/wp-calypso#103848 (comment).

The changes here ensure that the state value is consistently released after the pull finishes, successfully or otherwise.

Testing Instructions:

Verify test coverage fails when changes to src/api.ts are reset:

git checkout master -- src/api.ts
yarn test test/api.test.ts

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.

1 participant

Comments