Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
http: avoid possible digest mismatch error
There is a possibility to get a digest mismatch error if the metadata for previous download does not point to a valid reference anymore. To mitigate this, check that ref that etag points to is still valid before using it. Additionally `.cacheKey` property was not previously set in the cases where old reference was reused. This caused a case where even if the download needed to be performed again, it always failed validation, even if the digest had not actually changed since previous download. There is still a small possibility that gc/prune request will delete the downloaded record in between cachemap and exec call and that the contents changes in the server at that exact time. To fix that case we would need to modify cachemap so that it can keep hold of references until build is complete. Signed-off-by: Tonis Tiigi <[email protected]>
- Loading branch information