Skip to content

Conversation

@tonistiigi
Copy link
Member

New ResolverCache interface in JobContext allows build jobs to memorize and synchronize accesses to mutable remote resources.

This is to make sure that when multiple parts of the same build job, or build job and source metadata resolver access the same remote resources, it remains the same for the duration of the single build request, even if data happens to change on the remote side.

Fix such a possible case in the HTTP source. Even if the server now returns completely different data, if the same URL was accessed once for the ongoing build, then the initial contents are always used until the build completes.

LLM disclaimer: Unit tests for resolverCache and combinedResolverCache were initially GPT-5 generated

@tonistiigi
Copy link
Member Author

Added an additional commit for the Git case when reference changes to a different commit in the middle of the build request.

New ResolverCache interface in JobContext allows build jobs to
memorize and synchronize accesses to mutable remote resources.

This is to make sure that when multiple parts of the same build
job, or build job and source metadata resolver access the same
remote resources, it remains the same for the duration of the
single build request, even if data happens to change on the remote side.

Fix such a possible case in the HTTP source. Even if the server
now returns completely different data, if the same URL was accessed
once for the ongoing build, then the initial contents are always
used until the build completes.

Signed-off-by: Tonis Tiigi <[email protected]>
Make sure remote ref does not change to different commit  if
git repo changes in the middle of the build.

Signed-off-by: Tonis Tiigi <[email protected]>
@tonistiigi tonistiigi merged commit e6d9fcd into moby:master Oct 17, 2025
140 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants