fix: update retry handling to retry idempotent requests that encounter unexpected EOF while parsing json responses#1155
Merged
BenWhitehead merged 2 commits intogoogleapis:mainfrom Dec 13, 2021
BenWhitehead:retry-json-eof
Merged
fix: update retry handling to retry idempotent requests that encounter unexpected EOF while parsing json responses#1155BenWhitehead merged 2 commits intogoogleapis:mainfrom BenWhitehead:retry-json-eof
BenWhitehead merged 2 commits intogoogleapis:mainfrom
BenWhitehead:retry-json-eof
Conversation
Collaborator
Author
|
Blocked until the release of googleapis/storage-testbench#169 |
Contributor
|
Updated testbench name for broken stream after resumable upload completes. PTAL: googleapis/storage-testbench#169 |
…r unexpected EOF while parsing json responses ### Fix Update DefaultStorageRetryStrategy to account for EOF errors from Json. When parsing json it's possible we've only received a partial document and parsing will fail. If an unexpected EOF happens from parsing and the request is idempotent retry it. #### Tests Add two new integration tests which leverage the testbench to force the EOF to happen upon the completion of the resumable session. * Add 0B offset test * Add 10B offset test Add new cases to DefaultRetryHandlingBehaviorTest to ensure continued expected handling for the new EOF behavior. #### Refactor * Make TestBench.java (and its associated Builder) public to allow for use outside the retry conformance test package * Create new JUnit @rule DataGeneration moving com.google.cloud.storage.it.ITStorageTest#randString to it and change the signature to produce a ByteBuffer rather than a string. (this should simplify use since the strings returned were immediately turned to bytes) Fixes #1154 deps: update storage-testbench to v0.10.0
frankyn
approved these changes
Dec 10, 2021
| } | ||
|
|
||
| static final class RetryTestResource { | ||
| public static final class RetryTestResource { |
Contributor
There was a problem hiding this comment.
Why is this being set to public now?
Collaborator
Author
There was a problem hiding this comment.
So it can be used outside of the retry package in the IT package where I added the new test
frankyn
approved these changes
Dec 13, 2021
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.
Fix
Update DefaultStorageRetryStrategy to account for EOF errors from Json. When parsing json it's possible we've only received a partial document and parsing will fail. If an unexpected EOF happens from parsing and the request is idempotent retry it.
Tests
Add two new integration tests which leverage the testbench to force the EOF to happen upon the completion of the resumable session.
Add new cases to DefaultRetryHandlingBehaviorTest to ensure continued expected handling for the new EOF behavior.
Refactor
Fixes #1154