Save chunks to cache if GetChunks returns partial result#605
Merged
Conversation
Often, the error is caused by a timeout or client cancel, but the client may be on a retry loop and come straight back with the same request. So we should cache what we did get, and hence do better next time.
jml
approved these changes
Nov 21, 2017
Contributor
jml
left a comment
There was a problem hiding this comment.
Oh, cool. I'd be interested in seeing before & after stats on this. (But only ~15 minutes of effort interested).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If the chunk store has, say, 1,000 chunks to fetch, it will do them in a loop in batches of 100. Suppose it gets 900 fetched ok, then the next call hits an error: we should save the 900 to cache.
Reason is the client may be on a retry loop and come straight back with the same request. So we should cache what we did get, and hence do better next time.
Note we do not retain any chunks obtained by a call which did error; just the ones from earlier successful calls.