FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix: update grpc WriteObject response handling to provide context when a failure happens by BenWhitehead · Pull Request #2532 · googleapis/java-storage · GitHub

fix: update grpc WriteObject response handling to provide context when a failure happens - #2532

Merged
BenWhitehead merged 1 commit into
mainfrom
grpc-stricter-response-validation-better-messages
May 8, 2024
Merged

fix: update grpc WriteObject response handling to provide context when a failure happens#2532
BenWhitehead merged 1 commit into
mainfrom
grpc-stricter-response-validation-better-messages

Conversation

Copy link
Copy Markdown
Collaborator

Follow up to #2527

This updated errors from grpc chunked uploads to have messages that include useful debugging information.

When a response is received but doesn't validate with the expected state:

com.google.cloud.storage.StorageException: Attempt to append to already finalized resumable session.
	|> [
	|> 	com.google.storage.v2.WriteObjectRequest{
	|> 		upload_id: uploadId
	|> 		checksummed_data: {range: [0:262144]}
	|> 	}
	|> ]
	|  
	|< com.google.storage.v2.WriteObjectResponse{
	|< 	resource {
	|< 	  name: "obj"
	|< 	  size: 524288
	|< 	}
	|< }
	|

When an error is returned by GCS:

com.google.cloud.storage.StorageException: Client side data loss detected. Attempt to append to a resumable session with an offset higher than the backend has
	|> [
	|> 	com.google.storage.v2.WriteObjectRequest{
	|> 		upload_id: uploadId
	|> 		checksummed_data: {range: [262144:524288]}
	|> 	}
	|> ]
	|  
	|< Status{code=OUT_OF_RANGE, description=Upload request started at offset '262144', which is past expected offset '0'., cause=null}
	|< Metadata(content-type=application/grpc)
	| 

Also update exception propagation to add original call context as a suppressed exception in order to allow maintaining originating frames of the async failure.

BenWhitehead added the owlbot:ignore instruct owl-bot to ignore a PR label May 7, 2024
BenWhitehead requested a review from a team May 7, 2024 21:21
product-auto-label Bot added size: l Pull request size is large. api: storage Issues related to the googleapis/java-storage API. labels May 7, 2024
Base automatically changed from grpc-stricter-response-validation to main May 7, 2024 21:28
BenWhitehead force-pushed the grpc-stricter-response-validation-better-messages branch from e4ad8c1 to 8bfc3f0 Compare May 7, 2024 21:56
BenWhitehead merged commit 170a3f5 into main May 8, 2024
BenWhitehead deleted the grpc-stricter-response-validation-better-messages branch May 8, 2024 22:04
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

Labels

api: storage Issues related to the googleapis/java-storage API. owlbot:ignore instruct owl-bot to ignore a PR size: l Pull request size is large.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL