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

Hold the layer store lock while diffing #214

Merged
merged 1 commit into from
Sep 14, 2018

Conversation

nalind
Copy link
Member

@nalind nalind commented Sep 13, 2018

While generating a Diff, hold the lock on the layer store until after we've completely finished building the diff.

There's an internal Mount/Unmount being done so that we can read the layer's contents, and we don't update the mount counts properly if we're not still holding the lock when the layer store's Unmount() method is called, and that doesn't happen until the ReadCloser that Diff() returns gets closed.

This should fix containers/buildah#981.

While generating a Diff, hold the lock on the layer store until after
we've completely finished building the diff.

There's an internal Mount/Unmount being done so that we can read the
layer's contents, and we don't update the mount counts properly if we're
not still holding the lock when the layer store's Unmount() method is
called, which doesn't happen until the ReadCloser that Diff() returns
gets closed.

Signed-off-by: Nalin Dahyabhai <[email protected]>
@nalind nalind requested a review from rhatdan September 13, 2018 20:15
@TomSweeneyRedHat
Copy link
Member

LGTM assuming happy tests.

@rhatdan
Copy link
Member

rhatdan commented Sep 14, 2018

LGTM

@rhatdan rhatdan merged commit 02db7cb into containers:master Sep 14, 2018
@kbaegis
Copy link

kbaegis commented Sep 14, 2018

Thanks everyone!

@steveb
Copy link

steveb commented Sep 14, 2018

This fixes the problem I was seeing with concurrent buildah bud and skopeo copy calls.
I don't know if it was necessary, but I also tested with a skopeo revendored with this change.

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.

Subsequent push failures
5 participants