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

fix lease management with flightcontrol #4529

Merged
merged 1 commit into from
Jan 29, 2024

Conversation

tonistiigi
Copy link
Member

fixes #4419

When one flightcontrol callback gets canceled
ctx.Value() stops working for aquiring leases for
remaining callbacks. While this behavior should be also looked at more carefully, returning a lease for the first callback or for the remaining callback would not be correct as some objects can be tracked by first lease and that lease could be already deleted by the first callpath.

This fixes it so that any object tracked by flightcontrol callback will be copied to the lease of every codepath after the callback has returned.

@tonistiigi
Copy link
Member Author

@ktock Can you take a quick look at these "missing lease requirement" errors for stargz. I can easily remove this validation in Adopt() if leases are not needed for these functions but I don't want to hide any other possible bug if these code paths should actually have leases set in context. Atm. it seems to depend on the code path if a lease is set or not.

@ktock
Copy link
Collaborator

ktock commented Jan 9, 2024

Thanks for pinging me. According to the stack trace, the error comes from github.com/moby/buildkit/cache.(*immutableRef).prepareRemoteSnapshotsStargzMode and this function only creates snapshots that are traced by the ref's lease so I think it's OK the input ctx doesn't have lease.

When one flightcontrol callback gets canceled
ctx.Value() stops working for aquiring leases for
remaining callbacks. While this behavior should be
also looked at more carefully, returning a lease for
the first callback or for remaining callback would not
be correct as some objects can be tracked by first lease
and that lease could be already deleted by the first
callpath.

This fixes it so that any object tracked by flightcontrol
callback will be copied to the lease of every codepath
after the callback has returned.

Signed-off-by: Tonis Tiigi <[email protected]>
@tonistiigi tonistiigi merged commit 2d608c3 into moby:master Jan 29, 2024
60 checks passed
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.

unexpected error: missing lease requirement for setBlob
2 participants