GeezerVison is showing github.com — fix: retry using remote offset by frankyn · Pull Request #604 · googleapis/java-storage
This repository was archived by the owner on Sep 25, 2026. It is now read-only.
Conversation
Note: @JesseLovelace will be driving this PR to completion as I'll be OOO over the next two weeks. Thanks Jesse!
- Ensure the tests and linter pass
- Code coverage does not decrease
Fixes #603 ☕️
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Comment on lines
+143
to
+156
|
|
expect(storageRpcMock.writeWithResponse(
|
|
|
eq(UPLOAD_ID),
|
|
|
capture(capturedBuffer),
|
|
|
eq(0),
|
|
|
eq(0L),
|
|
|
eq(MIN_CHUNK_SIZE),
|
|
|
eq(false))).andThrow(exception);
|
|
|
expect(storageRpcMock.getCurrentUploadOffset(eq(UPLOAD_ID))).andReturn(0L);
|
|
|
expect(storageRpcMock.writeWithResponse(
|
|
|
eq(UPLOAD_ID),
|
|
|
capture(capturedBuffer),
|
|
|
eq(0),
|
|
|
eq(0L),
|
|
|
eq(MIN_CHUNK_SIZE),
|
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.
|
expect(storageRpcMock.writeWithResponse( |
|
eq(UPLOAD_ID), |
|
capture(capturedBuffer), |
|
eq(0), |
|
eq(0L), |
|
eq(MIN_CHUNK_SIZE), |
|
eq(false))).andThrow(exception); |
|
expect(storageRpcMock.getCurrentUploadOffset(eq(UPLOAD_ID))).andReturn(0L); |
|
expect(storageRpcMock.writeWithResponse( |
|
eq(UPLOAD_ID), |
|
capture(capturedBuffer), |
|
eq(0), |
|
eq(0L), |
|
eq(MIN_CHUNK_SIZE), |
|
expect( |
|
storageRpcMock.writeWithResponse( |
|
eq(UPLOAD_ID), |
|
capture(capturedBuffer), |
|
eq(0), |
|
eq(0L), |
|
eq(MIN_CHUNK_SIZE), |
|
eq(false))) |
|
.andThrow(exception); |
|
expect( |
|
storageRpcMock.writeWithResponse( |
|
eq(UPLOAD_ID), |
|
capture(capturedBuffer), |
|
eq(0), |
|
eq(0L), |
|
eq(MIN_CHUNK_SIZE), |
|
eq(false))) |
|
.andReturn(null); |
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Comment on lines
+173
to
+186
|
|
expect(storageRpcMock.writeWithResponse(
|
|
|
eq(UPLOAD_ID),
|
|
|
capture(capturedBuffer),
|
|
|
eq(0),
|
|
|
eq(0L),
|
|
|
eq(MIN_CHUNK_SIZE),
|
|
|
eq(false))).andThrow(exception);
|
|
|
expect(storageRpcMock.getCurrentUploadOffset(eq(UPLOAD_ID))).andReturn(10L);
|
|
|
expect(storageRpcMock.writeWithResponse(
|
|
|
eq(UPLOAD_ID),
|
|
|
capture(capturedBuffer),
|
|
|
eq(10),
|
|
|
eq(10L),
|
|
|
eq(MIN_CHUNK_SIZE - 10),
|
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.
|
expect(storageRpcMock.writeWithResponse( |
|
eq(UPLOAD_ID), |
|
capture(capturedBuffer), |
|
eq(0), |
|
eq(0L), |
|
eq(MIN_CHUNK_SIZE), |
|
eq(false))).andThrow(exception); |
|
expect(storageRpcMock.getCurrentUploadOffset(eq(UPLOAD_ID))).andReturn(10L); |
|
expect(storageRpcMock.writeWithResponse( |
|
eq(UPLOAD_ID), |
|
capture(capturedBuffer), |
|
eq(10), |
|
eq(10L), |
|
eq(MIN_CHUNK_SIZE - 10), |
|
expect( |
|
storageRpcMock.writeWithResponse( |
|
eq(UPLOAD_ID), |
|
capture(capturedBuffer), |
|
eq(0), |
|
eq(0L), |
|
eq(MIN_CHUNK_SIZE), |
|
eq(false))) |
|
.andThrow(exception); |
|
expect( |
|
storageRpcMock.writeWithResponse( |
|
eq(UPLOAD_ID), |
|
capture(capturedBuffer), |
|
eq(10), |
|
eq(10L), |
|
eq(MIN_CHUNK_SIZE - 10), |
|
eq(false))) |
|
.andReturn(null); |
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
codecov
Bot
commented
Nov 9, 2020
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Merging #604 (d987287) into master (ea25492) will decrease coverage by 0.35%.
The diff coverage is 38.80%.

@@ Coverage Diff @@
## master #604 +/- ##
============================================
- Coverage 64.68% 64.32% -0.36%
+ Complexity 629 621 -8
============================================
Files 32 32
Lines 5255 5317 +62
Branches 510 520 +10
============================================
+ Hits 3399 3420 +21
- Misses 1697 1735 +38
- Partials 159 162 +3
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ea25492...d987287. Read the comment docs.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
The coverage miss seems to be due to getCurrentUploadOffset in HttpStorageRpc not being tested. This is part of way bigger issue, that entire file doesn't seem to have any coverage. I'm going to go ahead and merge this as is and it should be a follow up issue to get coverage for HttpStorageRpc
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
littleK0i
commented
Nov 24, 2020
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|
I suspect, this fix did not go so well.
I am now getting following exceptions sometimes:
com.google.cloud.storage.StorageException: java.lang.NullPointerException
Stack trace:
com.google.cloud.storage.StorageException.translateAndThrow(StorageException.java:81)
com.google.cloud.storage.BlobWriteChannel.flushBuffer(BlobWriteChannel.java:180)
com.google.cloud.BaseWriteChannel.flush(BaseWriteChannel.java:112)
com.google.cloud.BaseWriteChannel.write(BaseWriteChannel.java:139)
java.base/java.nio.channels.Channels.writeFullyImpl(Channels.java:74)
java.base/java.nio.channels.Channels.writeFully(Channels.java:97)
java.base/java.nio.channels.Channels$1.write(Channels.java:172)
I think, at very least we should have a better error message.
I use version 1.113.4. I'll try to go back to 1.113.3 and see how it goes.
Thank you.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Thanks for letting us know, @wildraid!
Could you share a snippet of code that you used which caused this error?
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
@wildraid released a new version with a fix for the issue you raised. Thanks for calling it out!
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
@frankyn , great news! Thanks for your help!
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Reviewers
2 more reviewers
Reviewers whose approvals may not affect merge requirements
Uh oh!
There was an error while loading. Please reload this page.
Labels
api: storage
Issues related to the googleapis/java-storage API.
cla: yes
This human has signed the Contributor License Agreement.
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Retry Based on Remote Offset
Uh oh!
There was an error while loading. Please reload this page.
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.
|