fix(storage): add a safety check for readhandle#11549
Merged
gcf-merge-on-green[bot] merged 5 commits intogoogleapis:mainfrom Feb 24, 2025
Merged
fix(storage): add a safety check for readhandle#11549gcf-merge-on-green[bot] merged 5 commits intogoogleapis:mainfrom
gcf-merge-on-green[bot] merged 5 commits intogoogleapis:mainfrom
Conversation
tritone
approved these changes
Feb 12, 2025
This was referenced Mar 12, 2025
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.
By running some tests observed that default ReadObjectSpec looks like:
read_object_spec:{bucket:"projects/_/buckets/bucket-name" object:"obj-name" read_handle:{}}Which is not correct as we pass nil read_handle. Added an check in NewRangeReader and NewMultiRangeDownloader to only pass read_handle in read_object_spec when it is not nil.
Reason: Default value of readHandle that we attach to objectHandle will be []( same as default value of byte array).
In case nil read_handle is passed by user we would already be doing the slow auth hence adding the check should not be a issue in that case too.