GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

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

@frankyn

@frankyn frankyn commented Nov 9, 2020

Copy link
Copy Markdown
Contributor

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.

All reactions
@product-auto-label product-auto-label Bot added the api: storage Issues related to the googleapis/java-storage API. label Nov 9, 2020
@google-cla google-cla Bot added the cla: yes This human has signed the Contributor License Agreement. label Nov 9, 2020
@frankyn
frankyn requested a review from JesseLovelace November 9, 2020 08:05
@frankyn frankyn assigned JesseLovelace Nov 9, 2020
yoshi-code-bot
yoshi-code-bot reviewed Nov 9, 2020
View reviewed changes
Comment thread google-cloud-storage/src/test/java/com/google/cloud/storage/BlobWriteChannelTest.java Outdated
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),

@yoshi-code-bot yoshi-code-bot Nov 9, 2020

Copy link
Copy Markdown

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.

Suggested change
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.

All reactions
Comment thread google-cloud-storage/src/test/java/com/google/cloud/storage/BlobWriteChannelTest.java Outdated
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),

@yoshi-code-bot yoshi-code-bot Nov 9, 2020

Copy link
Copy Markdown

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.

Suggested change
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.

All reactions
Frank Natividad
fix: retry using remote offset
e47f1e0
@frankyn
frankyn force-pushed the raw_download branch from 0fdb9d7 to e47f1e0 Compare November 9, 2020 08:09
@codecov

codecov Bot commented Nov 9, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codecov Report

Merging #604 (d987287) into master (ea25492) will decrease coverage by 0.35%.
The diff coverage is 38.80%.

Impacted file tree graph

@@             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     
Impacted Files Coverage Δ Complexity Δ
...om/google/cloud/storage/spi/v1/HttpStorageRpc.java 1.55% <0.00%> (-0.04%) 2.00 <0.00> (ø)
...va/com/google/cloud/storage/spi/v1/StorageRpc.java 66.23% <ø> (ø) 0.00 <0.00> (ø)
...ogle/cloud/storage/testing/StorageRpcTestBase.java 94.11% <0.00%> (-1.89%) 48.00 <0.00> (ø)
...ava/com/google/cloud/storage/BlobWriteChannel.java 68.00% <61.90%> (-6.61%) 11.00 <1.00> (+1.00) ⬇️

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Frank Natividad and others added 2 commits November 13, 2020 10:32
Frank Natividad @JesseLovelace
fix: retry using remote offset
93ee6fd
@JesseLovelace
Merge branch 'raw_download' of github.com:googleapis/java-storage int…
d987287
…o raw_download
@JesseLovelace

JesseLovelace commented Nov 13, 2020

Copy link
Copy Markdown
Contributor

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

JesseLovelace
JesseLovelace approved these changes Nov 13, 2020
View reviewed changes
@JesseLovelace
JesseLovelace marked this pull request as ready for review November 13, 2020 18:40
@JesseLovelace
JesseLovelace requested a review from a team November 13, 2020 18:40
@JesseLovelace
JesseLovelace merged commit 216b52c into master Nov 13, 2020
@JesseLovelace
JesseLovelace deleted the raw_download branch November 13, 2020 18:44
@littleK0i

littleK0i commented Nov 24, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@frankyn

frankyn commented Nov 24, 2020

Copy link
Copy Markdown
Contributor Author

Thanks for letting us know, @wildraid!

Could you share a snippet of code that you used which caused this error?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@frankyn

frankyn commented Dec 11, 2020

Copy link
Copy Markdown
Contributor Author

@wildraid released a new version with a fix for the issue you raised. Thanks for calling it out!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@littleK0i

littleK0i commented Dec 11, 2020

Copy link
Copy Markdown

@frankyn , great news! Thanks for your help!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@n12c n12c mentioned this pull request Dec 16, 2020
StorageException: Resumable upload is already complete. #666
Closed
@frankyn frankyn mentioned this pull request Feb 17, 2021
google cloud storage: NPE from BlobId.java:119 #709
Closed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

2 more reviewers
@yoshi-code-bot yoshi-code-bot yoshi-code-bot left review comments
@JesseLovelace JesseLovelace JesseLovelace approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@JesseLovelace JesseLovelace

Labels

api: storage Issues related to the googleapis/java-storage API. cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

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.

4 participants

@frankyn @JesseLovelace @littleK0i @yoshi-code-bot
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.