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 — feat: add configurable checksumming for blob uploads and downloads by andrewsg · Pull Request #246 · googleapis/python-storage

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

Conversation

@andrewsg

@andrewsg andrewsg commented Aug 14, 2020

Copy link
Copy Markdown
Contributor

No description provided.

Sorry, something went wrong.

Uh oh!

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

All reactions
andrewsg added 7 commits August 10, 2020 10:53
@andrewsg
migration
1a9287c
@andrewsg
incremental
fde82b7
@andrewsg
merge
53a0904
@andrewsg
incremental
98e09e1
@andrewsg
unit tests pass
64f785a
@andrewsg
lint and system tests
5c2d78a
@andrewsg
merge
ce7726a
@andrewsg
andrewsg requested review from crwilcox and frankyn August 14, 2020 19:27
@google-cla google-cla Bot added the cla: yes This human has signed the Contributor License Agreement. label Aug 14, 2020
andrewsg
andrewsg commented Aug 14, 2020
View reviewed changes
Comment thread google/cloud/storage/blob.py
response = upload.transmit_next_chunk(transport, timeout=timeout)
except resumable_media.DataCorruption:
# Attempt to delete the corrupted object.
self.delete()

@andrewsg andrewsg Aug 14, 2020

Copy link
Copy Markdown
Contributor 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.

If this fails for any reason, both exceptions will be reported, using the Python exception pattern "During handling of the above exception, another exception occurred"

Sorry, something went wrong.

Uh oh!

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

All reactions

@tseaver tseaver Aug 17, 2020

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.

What occurs here if a valid previous generation of the blob exists?

Sorry, something went wrong.

Uh oh!

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

All reactions

@andrewsg andrewsg Aug 21, 2020

Copy link
Copy Markdown
Contributor 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.

In the default case, if versioning is off, there is no way to recover the older version. Unfortunately this can only be resolved by backend changes to make server-side checksumming possible for resumable uploads.

In the case where versioning is on, the previous generation still exists, but is not live. This is consistent with behavior in nodejs, which I modeled this code after. We could potentially try to roll back and make the previous version live, but we should also modify nodejs and other languages to be consistent across languages. What do you think?

Sorry, something went wrong.

Uh oh!

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

All reactions

@frankyn frankyn Aug 21, 2020

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 think this is more of a documentation issue until there's a better fix in the backend to support checksums better.

I'd prefer consistency here with clear acknowledgment that these cases can occur when using checksumming. It's not done automatically so it doesn't change behavior for uploads.

Sorry, something went wrong.

Uh oh!

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

All reactions
andrewsg
andrewsg commented Aug 14, 2020
View reviewed changes
Comment thread google/cloud/storage/blob.py
:type checksum: str
:param checksum:
(Optional) The type of checksum to compute to verify
the integrity of the object. If the upload is completed in a single

@andrewsg andrewsg Aug 14, 2020

Copy link
Copy Markdown
Contributor 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.

This "if the upload is completed in a single request" / "if the upload is too large" is undeniably ugly and hopefully we can implement server-side handling of resumable upload checksums to resolve that soon

Sorry, something went wrong.

Uh oh!

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

All reactions
@andrewsg
fix docs formatting
379d57b
@andrewsg andrewsg changed the title Add configurable checksumming for blob uploads and downloads feat: add configurable checksumming for blob uploads and downloads Aug 14, 2020
@andrewsg

andrewsg commented Aug 14, 2020

Copy link
Copy Markdown
Contributor Author

Recommend hold off on merging until google-resumable-media releases to 1.0 (and bump up the dependency version number in setup.py here)

All reactions

Sorry, something went wrong.

Uh oh!

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

@andrewsg
comment mock strategy
b7f7285
tseaver
tseaver suggested changes Aug 17, 2020
View reviewed changes
Comment thread tests/system/test_system.py Resolved

Uh oh!

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

@product-auto-label product-auto-label Bot added the api: storage Issues related to the googleapis/python-storage API. label Aug 21, 2020
frankyn
frankyn suggested changes Aug 21, 2020
View reviewed changes
Comment thread tests/system/test_system.py Resolved

Uh oh!

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

Comment thread google/cloud/storage/blob.py
response = upload.transmit_next_chunk(transport, timeout=timeout)
except resumable_media.DataCorruption:
# Attempt to delete the corrupted object.
self.delete()

@frankyn frankyn Aug 21, 2020

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 think this is more of a documentation issue until there's a better fix in the backend to support checksums better.

I'd prefer consistency here with clear acknowledgment that these cases can occur when using checksumming. It's not done automatically so it doesn't change behavior for uploads.

Sorry, something went wrong.

Uh oh!

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

All reactions
@tseaver
Merge branch 'master' into crc32c
296a526
@tseaver

tseaver commented Aug 24, 2020

Copy link
Copy Markdown
Contributor

googleapis/google-resumable-media-python#142 is the PR for bumping GRMP to 1.0.

All reactions

Sorry, something went wrong.

Uh oh!

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

@andrewsg
Test update
a554047
@andrewsg

andrewsg commented Aug 24, 2020

Copy link
Copy Markdown
Contributor Author

@tseaver @frankyn PTAL

@tseaver Has the PR you linked made it to release yet? If it's released I'll use this PR to also update setup.py to use the new version.

All reactions

Sorry, something went wrong.

Uh oh!

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

frankyn
frankyn reviewed Aug 25, 2020
View reviewed changes
Comment thread google/cloud/storage/blob.py Resolved

Uh oh!

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

andrewsg added 2 commits August 25, 2020 11:26
@andrewsg
update docstring and bump resumable media dependency
8489549
@andrewsg
Merge branch 'master' into crc32c
af5beca
@andrewsg

andrewsg commented Aug 25, 2020

Copy link
Copy Markdown
Contributor Author

Bumped version number. This should be good to merge as soon as final review comes through. Thanks all

All reactions

Sorry, something went wrong.

Uh oh!

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

frankyn
frankyn approved these changes Aug 25, 2020
View reviewed changes

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

LGTM, thanks @andrewsg!

Sorry, something went wrong.

Uh oh!

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

All reactions
@andrewsg

andrewsg commented Aug 26, 2020

Copy link
Copy Markdown
Contributor Author

@tseaver PTAL soon if you are available, I've been asked to release. Thanks!

All reactions

Sorry, something went wrong.

Uh oh!

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

@frankyn
Merge branch 'master' into crc32c
0dffbdc
@tseaver

tseaver commented Aug 26, 2020

Copy link
Copy Markdown
Contributor

https://pypi.org/project/google-resumable-media/1.0.0/ is released.

All reactions

Sorry, something went wrong.

Uh oh!

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

tseaver
tseaver approved these changes Aug 26, 2020
View reviewed changes
@tseaver
tseaver merged commit 23b7d1c into master Aug 26, 2020
@tseaver
tseaver deleted the crc32c branch August 26, 2020 19:20
@tseaver tseaver mentioned this pull request Dec 1, 2020
logging.info() triggers basicConfig() #332
Closed
cojenco pushed a commit to cojenco/python-storage that referenced this pull request Oct 13, 2021
@andrewsg @tseaver
@frankyn @cojenco
feat: add configurable checksumming for blob uploads and downloads (g…
c149785
…oogleapis#246)

Co-authored-by: Tres Seaver <[email protected]>
Co-authored-by: Frank Natividad <[email protected]>
cojenco pushed a commit to cojenco/python-storage that referenced this pull request Oct 13, 2021
@andrewsg @tseaver
@frankyn @cojenco
feat: add configurable checksumming for blob uploads and downloads (g…
ed18479
…oogleapis#246)

Co-authored-by: Tres Seaver <[email protected]>
Co-authored-by: Frank Natividad <[email protected]>
@release-please release-please Bot mentioned this pull request Jan 12, 2022
chore(main): release 3.0.0 #688
Closed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

@crwilcox crwilcox Awaiting requested review from crwilcox
2 more reviewers
@tseaver tseaver tseaver approved these changes
@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/python-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.

Uh oh!

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

3 participants

@andrewsg @tseaver @frankyn
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.