Skip to content

Fix memoization from new_blobs

Jerry Seto requested to merge remove-repository-new-blobs-memoization into master

What does this MR do and why?

When calling new_blobs repeatedly on the same repository object with different revisions, the same value is returned. This is due to the way newrevs is bound when the hash is instantiated. A closure is formed when the block is passed to the hash constructor so the value of newrevs remains the same for each call.

When calling new_blobs again on the same repository object with the same revisions an enumerator that is finished iterating can be returned. I think this is due to the memoized response being a kind of Enumerable (which does not appear to support any kind of rewinding).

This change fixes the memoization and caches an array rather than a BlobStitcher

Related: #393535 (closed)

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Vasilii Iakliushin

Merge request reports