storage icon indicating copy to clipboard operation
storage copied to clipboard

chunked layersCache seems to never be actually reused

Open mtrmac opened this issue 1 year ago • 1 comments

A side discovery I can’t delve into now: https://github.com/containers/storage/blob/98ad80d6d16593c959d77b03b33af555eb620891/pkg/chunked/cache_linux.go#L114 defines a new local variable, it does not change the value of the global singleton: https://github.com/containers/storage/blob/98ad80d6d16593c959d77b03b33af555eb620891/pkg/chunked/cache_linux.go#L77

AFAICS that means every cache user ( = every chunked differ = every layer extraction) builds the cache from scratch. The fix is trivial in itself, but it would expose currently-impossible concurrency, so it might need specific testing.

Cc: @giuseppe

mtrmac avatar Jul 12 '24 18:07 mtrmac

tentative fix: https://github.com/containers/storage/pull/2024

still marked as Draft as I need to test it better and validate that the locking is still correct

giuseppe avatar Jul 12 '24 21:07 giuseppe