Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(storage): add a safety check for readhandle #11549

Merged
merged 5 commits into from
Feb 24, 2025

Conversation

shubham-diwakar
Copy link
Contributor

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.

Verified

This commit was signed with the committer’s verified signature.
shubham-diwakar Shubham Diwakar
@product-auto-label product-auto-label bot added the api: storage Issues related to the Cloud Storage API. label Jan 31, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@shubham-diwakar shubham-diwakar marked this pull request as ready for review January 31, 2025 22:02
@shubham-diwakar shubham-diwakar requested review from a team as code owners January 31, 2025 22:02
tritone and others added 3 commits February 12, 2025 09:45

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@tritone tritone added kokoro:force-run Add this label to force Kokoro to re-run the tests. automerge Merge the pull request once unit tests and other checks pass. labels Feb 24, 2025
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Feb 24, 2025
@gcf-merge-on-green gcf-merge-on-green bot merged commit c9edb37 into googleapis:main Feb 24, 2025
8 checks passed
@gcf-merge-on-green gcf-merge-on-green bot removed the automerge Merge the pull request once unit tests and other checks pass. label Feb 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the Cloud Storage API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants