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
Changes from 2 commits
3d5a723
d00c044
372861d
b67a0a2
bcf037f
cb562b0
5446314
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. nit: create constants for compared values instead of commenting 201 -> |
||
return -1; | ||
} | ||
StringBuilder sb = new StringBuilder(); | ||
|
@@ -783,11 +784,7 @@ public long getCurrentUploadOffset(String uploadId) { | |
// Return next byte offset by adding 1 to last byte received offset | ||
return Long.parseLong(range.substring(range.indexOf("-") + 1)) + 1; | ||
} else { | ||
// Not certain what went wrong | ||
StringBuilder sb = new StringBuilder(); | ||
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 commentThe reason will be displayed to describe this comment to others. Learn more. We don't want to keep the information in the exception message? |
||
} | ||
} finally { | ||
if (response != null) { | ||
|
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
vsRemote
can we extract a method of this logic so it's easier to keep in sync?