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: improve error detection and reporting for BlobWriteChannel retry state by BenWhitehead · Pull Request #846 · googleapis/java-storage

This repository was archived by the owner on Sep 25, 2026. It is now read-only.

Conversation

@BenWhitehead

@BenWhitehead BenWhitehead commented May 26, 2021

Copy link
Copy Markdown
Collaborator

Add new checks to ensure a more informative error than NullPointerException is thrown if the StorageObject or it's size are unable to be resolved on the last chunk.

Fixes #839

Sorry, something went wrong.

Uh oh!

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

All reactions
@BenWhitehead
fix: improve error detection and reporting for BlobWriteChannel retry…
d597c33
… state

Add new checks to ensure a more informative error than NullPointerException is thrown if the StorageObject or it's size are unable to be resolved on the last chunk.

Fixes #839
@BenWhitehead
BenWhitehead requested review from a team and frankyn May 26, 2021 01:25
@product-auto-label product-auto-label Bot added the api: storage Issues related to the googleapis/java-storage API. label May 26, 2021
@google-cla google-cla Bot added the cla: yes This human has signed the Contributor License Agreement. label May 26, 2021
tritone
tritone reviewed May 26, 2021
View reviewed changes

@tritone tritone left a comment

Copy link
Copy Markdown
Contributor

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.

Generally seems like a good improvement, one question

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread google-cloud-storage/src/main/java/com/google/cloud/storage/BlobWriteChannel.java
localPosition,
remotePosition,
last,
"Unable to recover in upload.\nThis may be a symptom of multiple clients uploading to the same upload session.");

@tritone tritone May 26, 2021

Copy link
Copy Markdown
Contributor

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.

I don't think multiple clients uploading to the same session is possible? The session should be created by the client and then only used by that client AFAIK.

Sorry, something went wrong.

Uh oh!

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

All reactions

@BenWhitehead BenWhitehead May 26, 2021

Copy link
Copy Markdown
Collaborator Author

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.

@frankyn Do you have context on why this was the original message? (I refactored it to a parameter so I could reuse the details formatting code).

Sorry, something went wrong.

Uh oh!

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

All reactions

@frankyn frankyn Jun 1, 2021

Copy link
Copy Markdown
Contributor

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.

It's possible if the upload URI is shared between clients. GCS API supports it, however it's very unlikely it's a possible case.

Sorry, something went wrong.

Uh oh!

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

All reactions
@frankyn
frankyn requested a review from JesseLovelace May 26, 2021 18:59
frankyn
frankyn approved these changes Jun 1, 2021
View reviewed changes
@BenWhitehead
BenWhitehead merged commit d0f2184 into googleapis:master Jun 1, 2021
@BenWhitehead
BenWhitehead deleted the improve-error-reporting_839 branch June 1, 2021 19:07
gcf-merge-on-green Bot pushed a commit that referenced this pull request Jun 1, 2021
@release-please
chore: release 1.115.0 (#834)
0018bcb
🤖 I have created a release \*beep\* \*boop\*
---
## [1.115.0](https://www.github.com/googleapis/java-storage/compare/v1.114.0...v1.115.0) (2021-06-01)


### Features

* add `gcf-owl-bot[bot]` to `ignoreAuthors` ([#837](https://www.github.com/googleapis/java-storage/issues/837)) ([fe8e98a](https://www.github.com/googleapis/java-storage/commit/fe8e98a229f472c1f29d206d937690660bfa1444))


### Bug Fixes

* improve error detection and reporting for BlobWriteChannel retry state ([#846](https://www.github.com/googleapis/java-storage/issues/846)) ([d0f2184](https://www.github.com/googleapis/java-storage/commit/d0f2184f4dd2d99a4315f260f35421358d14a2df)), closes [#839](https://www.github.com/googleapis/java-storage/issues/839)
* update BucketInfo translation code to properly handle lifecycle rules ([#852](https://www.github.com/googleapis/java-storage/issues/852)) ([3b1df1d](https://www.github.com/googleapis/java-storage/commit/3b1df1d00a459b134103bc8738f0294188502a37)), closes [#850](https://www.github.com/googleapis/java-storage/issues/850)


### Dependencies

* update dependency com.google.cloud:google-cloud-shared-dependencies to v1.2.0 ([#836](https://www.github.com/googleapis/java-storage/issues/836)) ([c1752ce](https://www.github.com/googleapis/java-storage/commit/c1752ce17d5d723d0ea36c41d98ae2bc9201fec2))
* update kms.version to v0.88.4 ([#830](https://www.github.com/googleapis/java-storage/issues/830)) ([7e3dc28](https://www.github.com/googleapis/java-storage/commit/7e3dc287e4285a9312393179671a78c569e7e869))
* update kms.version to v0.89.0 ([#855](https://www.github.com/googleapis/java-storage/issues/855)) ([29236e9](https://www.github.com/googleapis/java-storage/commit/29236e9d2eefb0e64b1b9bbfc532f4c3ae3e9ea4))
---


This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
@BenWhitehead BenWhitehead mentioned this pull request Sep 1, 2021
fix(1.113.14-sp): backport critical bug fixes #993
Merged
BenWhitehead added a commit that referenced this pull request Sep 28, 2021
@BenWhitehead @JesseLovelace @tritone
fix(1.113.14-sp): backport critical bug fixes (#993)
447d35d
* feat: Remove client side vaildation for lifecycle conditions (#816)

* Remove client side vaildation for lifecycle conditions

* fix lint and suggest updating

(cherry picked from commit 5ec84cc)

* fix: update BucketInfo translation code to properly handle lifecycle rules (#852)

Fixes #850

(cherry picked from commit 3b1df1d)

* fix: improve error detection and reporting for BlobWriteChannel retry state (#846)

Add new checks to ensure a more informative error than NullPointerException is thrown if the StorageObject or it's size are unable to be resolved on the last chunk.

Fixes #839

(cherry picked from commit d0f2184)

* fix: correct lastChunk retry logic in BlobWriteChannel (#918)

Add new method StorageRpc#queryResumableUpload which allows getting a shallow StorageObject for a resumable upload session which is complete.

Update BlobWriteChannel to use StoageRpc#queryResumableUpload instead of StorageRpc#get when attempting to validate the upload size of an object when it determines the upload is complete and is on the last chunk.

If a BlobWriteChannel is opened with a conditional like IfGenerationMatch it is not possible to simply get the object, as the object can drift generationally while the resumable upload is being performed.

Related to #839

(cherry picked from commit ab0228c)

* test: remove error string matching (#861)

It looks like the text for this error on the backend has changed
(sometimes) from "Precondition Failed" to "At least one of the
pre-conditions you specified did not hold". I don't think it's
really necessary to check the exact message in any case given
that we do check for a code of 412, which implies a precondition
failure. I added a check of the error Reason instead,  which is more
standardized.

Fixes #853

(cherry picked from commit 146a3d3)

Co-authored-by: JesseLovelace <[email protected]>
Co-authored-by: Chris Cotter <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

@JesseLovelace JesseLovelace Awaiting requested review from JesseLovelace
2 more reviewers
@tritone tritone tritone left review comments
@frankyn frankyn frankyn approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

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

Assignees

No one assigned

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.

Storage: BlobWriteChannel generates NullPointerException in some failure cases (e.g. networking issues)

Uh oh!

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

3 participants

@BenWhitehead @frankyn @tritone
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.