-
Notifications
You must be signed in to change notification settings - Fork 202
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
libimage, ManifestList: fslock
and reload
to provide race-free Add
API
#1090
Conversation
`podman manifest add` uses `ManifestList.Add(` but of now `Add(` does not locks while adding instances to the list thus causing race scenarios where storage is not reloaded and overrided by another invocation of the command. Following problem is solved in two steps * Add -> LockByInstance: Acquire a fs lock by instance ID so other invocation waits until this invocation completes its write. * Add -> LockByInstance -> reload: Reload instance digests from storage just after acquiring lock to make sure we are not overriding any just written instance. Reproducer: containers/podman#14667 (comment) Closes: containers/podman#14667 [NO NEW TESTS NEEDED] [NO TESTS NEEDED] This needes integration tests so its hard to verify race in CI. Signed-off-by: Aditya R <[email protected]>
b7ed55c
to
8a786cc
Compare
/approved |
LGTM, but I'd like an ack from @vrothberg before we merge |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, nice work, @flouthoc
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: flouthoc, vrothberg The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/lgtm |
Thanks, Syncing this to buildah and podman so i can update the BZ |
podman manifest add
usesManifestList.Add(
but as of nowAdd(
doesnot locks while adding instances to the list thus causing race scenarios
where storage is not reloaded and overridden by another invocation of the
command.
Following problem is solved in two steps
invocation waits until this invocation completes its write.
just after acquiring lock to make sure we are not overriding any just
written instance.
Reproducer: containers/podman#14667 (comment)
Closes: BZ#2105173
Closes: containers/podman#14667
[NO NEW TESTS NEEDED]
[NO TESTS NEEDED]
This needs integration tests so its hard to verify race in c/common CI