On cache miss, we'll expand and APK into a tempdir, then move all the files into the final place in our cache dir. On ExpandedAPK.Close(), we'll remove that tempdir.
If we have concurrent images installing the same package, one might clean up the tempdir while the other still has a reference to the tarball sitting in the tempdir, so subsequent reads fail.
Instead, we need to re-instantiate the tarfs after we move it to the cache dir. This could be much more efficient (we re-scan the tar). I'm working on that in a separate branch, so left a TODO for now.
On cache miss, we'll expand and APK into a tempdir, then move all the files into the final place in our cache dir. On ExpandedAPK.Close(), we'll remove that tempdir.
If we have concurrent images installing the same package, one might clean up the tempdir while the other still has a reference to the tarball sitting in the tempdir, so subsequent reads fail.
Instead, we need to re-instantiate the tarfs after we move it to the cache dir. This could be much more efficient (we re-scan the tar). I'm working on that in a separate branch, so left a TODO for now.