Remove the per-rpc timeout in cachetools.GetBlob#11369
Merged
Conversation
This per-rpc timeout was only applied in the retriable case, which became more common after #9860. We already enforce a timeout on each `stream.Recv` call, and it doesn't make sense to enforce the same timeout on the overall RPC. Also, it's difficult to pick a timeout for the whole streaming RPC, because the time depends directly on the size of the blob. We could scale the timeout with the size of the resource (something like 1 second for each 100KB), but that seems pretty finicky. Also, we're not setting a per-RPC deadline for `bytestream.Write` calls in `cachetools.UploadFromReaderWithCompression`.
vadimberezniker
approved these changes
Feb 20, 2026
bduffany
reviewed
Feb 20, 2026
Member
bduffany
left a comment
There was a problem hiding this comment.
If I understand the code correctly we have a timeout on each Recv but not the initial Read() call, so this change effectively removes the timeout on the initial Read? could that be problematic?
Contributor
Author
Yeah, the initial |
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.
This per-rpc timeout was only applied in the retriable case, which became more common after #9860.
We already enforce a timeout on each
stream.Recvcall, and it doesn't make sense to enforce the same timeout on the overall RPC. Also, it's difficult to pick a timeout for the whole streaming RPC, because the time depends directly on the size of the blob. We could scale the timeout with the size of the resource (something like 1 second for each 100KB), but that seems pretty finicky.Also, we're not setting a per-RPC deadline for
bytestream.Writecalls incachetools.UploadFromReaderWithCompression.