-
Notifications
You must be signed in to change notification settings - Fork 80
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: update retry handling to retry idempotent requests that encounter unexpected EOF while parsing json responses #1155
Conversation
Blocked until the release of googleapis/storage-testbench#169 |
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
return new Builder(); | ||
} | ||
|
||
static final class RetryTestResource { | ||
public static final class RetryTestResource { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this being set to public now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So it can be used outside of the retry package in the IT package where I added the new test
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