-
Notifications
You must be signed in to change notification settings - Fork 77
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: retrying get remote offset and recover from last chunk failures. #726
Conversation
Codecov Report
@@ Coverage Diff @@
## master #726 +/- ##
============================================
+ Coverage 64.33% 64.60% +0.26%
- Complexity 621 634 +13
============================================
Files 32 32
Lines 5322 5311 -11
Branches 521 519 -2
============================================
+ Hits 3424 3431 +7
+ Misses 1733 1718 -15
+ Partials 165 162 -3
Continue to review full report at Codecov.
|
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.
Just a few minor comments/questions
} | ||
|
||
@Test | ||
public void testWriteWithDriftRetryCase10() throws IOException { |
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.
nit: I don't know what case N is,
If easy can we improve these test names? maybe something like
testWriteWithDriftRetry_exceptionWhileWriting
@@ -766,6 +766,7 @@ public long getCurrentUploadOffset(String uploadId) { | |||
response = httpRequest.execute(); | |||
int code = response.getStatusCode(); | |||
if (code == 201 || code == 200) { | |||
// Upload completed successfully |
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.
nit: create constants for compared values instead of commenting
201 -> STATUS_CREATED
200 -> STATUS_OK
sb.append("Not sure what occurred. Here's debugging information:\n"); | ||
sb.append("Response:\n").append(ex.toString()).append("\n\n"); | ||
throw new StorageException(0, sb.toString()); | ||
throw translate(ex); |
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.
We don't want to keep the information in the exception message?
sb.append("uploadId: ").append(getUploadId()).append('\n'); | ||
sb.append("localNextByteOffset: ").append(localNextByteOffset).append('\n'); | ||
sb.append("remoteNextByteOffset: ").append(remoteNextByteOffset).append('\n'); | ||
sb.append("driftOffset: ").append(driftOffset).append("\n\n"); |
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.
nit: only diff between this block and case 4 is Local
vs Remote
can we extract a method of this logic so it's easier to keep in sync?
🤖 I have created a release \*beep\* \*boop\* --- ### [1.113.12](https://www.github.com/googleapis/java-storage/compare/v1.113.11...v1.113.12) (2021-02-26) ### Bug Fixes * retrying get remote offset and recover from last chunk failures. ([#726](https://www.github.com/googleapis/java-storage/issues/726)) ([b41b881](https://www.github.com/googleapis/java-storage/commit/b41b88109e13b5ebbd0393d1f264225c12876be6)) ### Dependencies * update dependency com.google.api-client:google-api-client to v1.31.2 ([#686](https://www.github.com/googleapis/java-storage/issues/686)) ([6b1f036](https://www.github.com/googleapis/java-storage/commit/6b1f0361376167719ec5456181134136d27d1d3c)) * update dependency com.google.cloud:google-cloud-shared-dependencies to v0.20.0 ([#732](https://www.github.com/googleapis/java-storage/issues/732)) ([c98413d](https://www.github.com/googleapis/java-storage/commit/c98413df9d9514340aed78b5a4d5e596760bb616)) * update kms.version to v0.87.7 ([#724](https://www.github.com/googleapis/java-storage/issues/724)) ([3229bd8](https://www.github.com/googleapis/java-storage/commit/3229bd860f3a4d700a969aa9e922bbf6b5c1ca10)) * update kms.version to v0.87.8 ([#733](https://www.github.com/googleapis/java-storage/issues/733)) ([a21b75f](https://www.github.com/googleapis/java-storage/commit/a21b75fa846f373970298dd98f8f3520fc2b3c97)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
I added three things in this PR:
Fixes #709 #687 ☕️