Skip to content
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

Incorrect start offset when range reads are interrupted #446

Closed
wilson1yan opened this issue Jul 31, 2024 · 4 comments · Fixed by #450
Closed

Incorrect start offset when range reads are interrupted #446

wilson1yan opened this issue Jul 31, 2024 · 4 comments · Fixed by #450
Assignees
Labels
api: storage Issues related to the googleapis/google-resumable-media-python API.

Comments

@wilson1yan
Copy link

wilson1yan commented Jul 31, 2024

Environment details

GCP A100 machines
(unclear about exact software, as this bug was countered internally on Google infra when running on XManager Cloud)

Steps to reproduce

Given a range read of start to end bytes, if the read is interrupted, the code here will make another GET request at the wrong start offset, as it should be self.start + self._bytes_downloaded if self.start is not None. Currently, the downloader will return end + 1 bytes instead of end - start + 1 bytes after resuming from interruption even when start is specified.

The same issue also probably happens here in Downloader.

We encountered this issue when using the google python storage library in the setting where we had thousands of workers doing repeated range reads on the same GCS file. Code would run and return the wrong bytes somewhere 20-60min in. Adding in a fix (see pull request) seemed to resolve the issue.

@product-auto-label product-auto-label bot added the api: storage Issues related to the googleapis/google-resumable-media-python API. label Jul 31, 2024
@andrewsg
Copy link
Contributor

andrewsg commented Aug 6, 2024

Thanks very much! Looking at this now. I need to add tests so I may work on a separate PR for this issue but I appreciate your fix as well.

@wilson1yan
Copy link
Author

Sounds good, feel free to work on a separate PR! Just thought I'd let you all know about the bug.

Please let me know when you end up applying the fix and/or push a new pip release. As right now my project is pip installing from this pull request directly, but would be good to just install an official pypi version thats updated.

@andrewsg
Copy link
Contributor

andrewsg commented Aug 7, 2024

@wilson1yan This is now being released as v2.7.2. Thanks again.

@wilson1yan
Copy link
Author

Awesome, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the googleapis/google-resumable-media-python API.
Projects
None yet
2 participants