Skip to content

Conversation

BenWhitehead
Copy link
Collaborator

The GCS API that underpins Storage#copy(CopyRequest) is storage.objects.rewrite.

A rewrite is technically what we now refer to in Google Cloud API land as a Long Running Operation, meaning it's structured in such a way as to be able to take longer than would normally be acceptable for a single RPC.

In the case of performing the rewrite, GCS is "moving" the bytes over the google network and won't respond to the request at all until complete. If it takes GCS more than the client configured read timeout to actually "move" the bytes, the client interprets it as a read timeout and fails out.

Update the code snippet for copy to make it more robust to large objects.

@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 Feb 4, 2025
Copy link
Contributor

@tritone tritone left a comment

Choose a reason for hiding this comment

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

Nice changes!

@BenWhitehead BenWhitehead merged commit 971ca5d into main Feb 5, 2025
21 checks passed
@BenWhitehead BenWhitehead deleted the docs/copy-sample-improvements branch February 5, 2025 18:28
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. size: m Pull request size is medium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants