Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
libimage, ManifestList: fs lock and reload to provide race-free Add API
`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]>
- Loading branch information