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

Creation of Zstd:chunked layers seems racy #1979

Closed
mtrmac opened this issue Jun 1, 2023 · 5 comments
Closed

Creation of Zstd:chunked layers seems racy #1979

mtrmac opened this issue Jun 1, 2023 · 5 comments
Labels
kind/bug A defect in an existing functionality (or a PR fixing it)

Comments

@mtrmac
Copy link
Collaborator

mtrmac commented Jun 1, 2023

Reading the code (not testing this),

layer, err := s.imageRef.transport.store.CreateLayer(id, lastLayer, nil, "", false, nil)
creates a layer, and
if err := s.imageRef.transport.store.ApplyDiffFromStagingDirectory(layer.ID, diffOutput.Target, diffOutput, nil); err != nil {
later fills the contents.

AFAICS the layer is, in the meantime, visible to other processes, who can find it based on the deterministic “chain ID”, and try to use it, while the contents are missing.

Cc: @giuseppe

@giuseppe
Copy link
Member

giuseppe commented Jun 2, 2023

this was added before we had something like PutLayer that combines CreateLayer and ApplyDiff.

We may need something like CreateLayerFromStagingDirectory to solve the problem in a similar way

@mtrmac
Copy link
Collaborator Author

mtrmac commented Jun 2, 2023

Yes — now that we are looking into this area, I just wanted to record that we will need a c/storage API update.

That might interact with other changes we may need to make…

@mtrmac mtrmac added the kind/bug A defect in an existing functionality (or a PR fixing it) label Jun 30, 2023
@mtrmac
Copy link
Collaborator Author

mtrmac commented Feb 9, 2024

@giuseppe this seems to be a blocker for production use.

@giuseppe
Copy link
Member

opened a PR for c/storage: containers/storage#1826

@mtrmac
Copy link
Collaborator Author

mtrmac commented Feb 16, 2024

#2301 has completed the fix.

@mtrmac mtrmac closed this as completed Feb 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug A defect in an existing functionality (or a PR fixing it)
Projects
None yet
Development

No branches or pull requests

2 participants