KEMBAR78
fix: update BlobReadChannelV2 handling to correctly restart for decompressed object by BenWhitehead · Pull Request #1867 · googleapis/java-storage · GitHub
Skip to content

Conversation

BenWhitehead
Copy link
Collaborator

When downloading bytes from gcs and decompressing them, a restart of the stream needs to pickup from the offset within the compressed bytes not the decompressed bytes.

Prior to this change http-client was automatically applying gzip decompression to the stream it returns to us thereby causing our tracking to be off.

This change updates our interaction with http client to always request the raw bytes without any transform applied to them, we then at a higher level can handle whether gzip decompression needs to be plumbed in.

Fix up a couple channel closed state subtleties when buffering is used with decompression.

Add a new test leveraging the testbench which forces a broken stream on some compressed object bytes. NOTE This test depends on the next release of testbench and will be failing until we get that release.

@BenWhitehead BenWhitehead added the owlbot:ignore instruct owl-bot to ignore a PR label Jan 20, 2023
@BenWhitehead BenWhitehead requested a review from a team as a code owner January 20, 2023 18:57
@product-auto-label product-auto-label bot added size: m Pull request size is medium. api: storage Issues related to the googleapis/java-storage API. labels Jan 20, 2023
Base automatically changed from read/expose-shallow-metadata to main January 20, 2023 19:00
@BenWhitehead BenWhitehead requested a review from a team as a code owner January 20, 2023 19:00
…pressed object

When downloading bytes from gcs and decompressing them, a restart of the stream needs to pickup from the offset within the compressed bytes not the decompressed bytes.

Prior to this change http-client was automatically applying gzip decompression to the stream it returns to us thereby causing our tracking to be off.

This change updates our interaction with http client to always request the raw bytes without any transform applied to them, we then at a higher level can handle whether gzip decompression needs to be plumbed in.

Fix up a couple channel closed state subtleties when buffering is used with decompression.

Add a new test leveraging the testbench which forces a broken stream on some compressed object bytes. _NOTE_ This test depends on the next release of testbench and will be failing until we get that release.
@BenWhitehead BenWhitehead force-pushed the fix/gzip-auto-restart branch from dbe0841 to 4e6edbd Compare January 20, 2023 19:13
Copy link
Contributor

@sydney-munro sydney-munro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@BenWhitehead BenWhitehead merged commit 93e8ed4 into main Jan 20, 2023
@BenWhitehead BenWhitehead deleted the fix/gzip-auto-restart branch January 20, 2023 21:23
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 googleapis/java-storage API. owlbot:ignore instruct owl-bot to ignore a PR size: m Pull request size is medium.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants