Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker: refactor PullImage future handling #24992

Merged
merged 1 commit into from
Feb 7, 2025
Merged

Conversation

gulducat
Copy link
Member

PR #24981 fixes a bug that I think this would have prevented.

Instead of requiring humans understand/remember that within pullImageImpl(), each return needs an associated future.set(), this set()s in the outer scope where the future is created and wait()ed on. So now pullImageImpl() can be a simple normal function without needing to worry about any future business.

No new tests needed for this. At least most of the relevant code paths are covered by existing tests (including some added in PR #24991, which this builds upon), so the overall contract for PullImage() is intact.

@gulducat gulducat added theme/driver/docker backport/1.9.x backport to 1.9.x release line labels Jan 31, 2025
@gulducat gulducat requested review from a team as code owners January 31, 2025 17:11
Copy link
Member

@mismithhisler mismithhisler left a comment

Choose a reason for hiding this comment

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

Looks good!

mismithhisler
mismithhisler previously approved these changes Feb 7, 2025
Copy link
Member

@mismithhisler mismithhisler left a comment

Choose a reason for hiding this comment

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

LGTM!

Base automatically changed from b-docker-image_pull_timeout to main February 7, 2025 17:36
@gulducat gulducat dismissed mismithhisler’s stale review February 7, 2025 17:36

The base branch was changed.

at least one bug has been created because it's
easy to miss a future.set() in pullImageImpl()

this pulls future.set() out to PullImage(),
the same level where it's created and wait()ed
@gulducat gulducat merged commit 91194b3 into main Feb 7, 2025
30 checks passed
@gulducat gulducat deleted the docker-easier-future branch February 7, 2025 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/1.9.x backport to 1.9.x release line theme/driver/docker
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants