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

flightcontrol: add cachedgroup struct #5022

Merged
merged 3 commits into from
Jun 19, 2024

Conversation

tonistiigi
Copy link
Member

This adds an additional version of flightcontrol.Group that caches previous results and returns earlier result if callback was already called for the same key.

Also refactor llb.Async and dockerui to use the new group. There are more cases that can be updated in follow-ups, for example in solver and puller, when implementing #4971 and rewriting https:/docker/buildx/blob/v0.15.0/build/driver.go#L50-L60 .

Initially, this version was not used because without generics, it would have been quite hacky to do the interace{} type casts everywhere.

@thompson-shaun thompson-shaun added this to the v0.15.0 milestone Jun 13, 2024
return 0, errors.Errorf("some error")
})

require.Error(t, err)
Copy link
Member

Choose a reason for hiding this comment

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

nit: this line does not seem needed, as it is covered by the ErrorContains below

@AkihiroSuda AkihiroSuda merged commit 01d7739 into moby:master Jun 19, 2024
75 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.

4 participants