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

DefaultStorageRpc.read setting wrong range #373

Closed
mziccard opened this issue Nov 13, 2015 · 2 comments · Fixed by #375
Closed

DefaultStorageRpc.read setting wrong range #373

mziccard opened this issue Nov 13, 2015 · 2 comments · Fixed by #375
Assignees
Labels
api: storage Issues related to the Cloud Storage API. 🚨 This issue needs some love. triage me I really want to be triaged. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@mziccard
Copy link
Contributor

In DefaultStorageRpc.read we set the content range as:

public byte[] read(StorageObject from, Map<Option, ?> options, long position, int bytes)
    throws StorageException {
  ...
  downloader.setContentRange(position, (int) position + bytes);
  ...
}

Accorting to here positions are inclusive, so we should probably do: downloader.setContentRange(position, (int) position + bytes - 1);

@mziccard mziccard added type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. api: storage Issues related to the Cloud Storage API. labels Nov 13, 2015
@aozarov
Copy link
Contributor

aozarov commented Nov 13, 2015

Yes, I think you are right.

I think consequences of this bug are minor and basically turns our chunkSize max to be chunkSize + 1 or in the "worse" case when the given byteBuffer is more than chunkSize we will be left with one extra byte to be consumed by itself in the next read).

Am I correct? Regardless, good catch and it should be fixed.

I am actually more concern though about googleapis/google-api-java-client#937 as it will impact large downloads. (maybe we should send them a PR...)

@mziccard
Copy link
Contributor Author

Yes exactly that was the problem I experienced when doing some tests for #359, a single byte was unexpectedly left to be read.

I am happy to send a PR to fix googleapis/google-api-java-client#937

@yoshi-automation yoshi-automation added 🚨 This issue needs some love. triage me I really want to be triaged. labels Apr 6, 2020
github-actions bot pushed a commit to suztomo/google-cloud-java that referenced this issue Jun 29, 2022
github-actions bot pushed a commit to suztomo/google-cloud-java that referenced this issue Jun 29, 2022
github-actions bot pushed a commit that referenced this issue Jul 14, 2022
…onfig to v1.5.1 (#373)

* build(deps): update dependency com.google.cloud:google-cloud-shared-config to v1.5.1

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
github-actions bot pushed a commit that referenced this issue Aug 1, 2022
…onfig to v1.5.3 (#373)

[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [com.google.cloud:google-cloud-shared-config](https://togithub.com/googleapis/java-shared-config) | `1.5.2` -> `1.5.3` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/1.5.3/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/1.5.3/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/1.5.3/compatibility-slim/1.5.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/1.5.3/confidence-slim/1.5.2)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>googleapis/java-shared-config</summary>

### [`v1.5.3`](https://togithub.com/googleapis/java-shared-config/blob/HEAD/CHANGELOG.md#&#8203;153-httpsgithubcomgoogleapisjava-shared-configcomparev152v153-2022-07-27)

[Compare Source](https://togithub.com/googleapis/java-shared-config/compare/v1.5.2...v1.5.3)

##### Dependencies

-   update dependency org.junit.vintage:junit-vintage-engine to v5.9.0 ([#&#8203;497](https://togithub.com/googleapis/java-shared-config/issues/497)) ([1fc6ab4](https://togithub.com/googleapis/java-shared-config/commit/1fc6ab445624cd4f9c8b161d109f346a9e5ed09a))
-   Update doclet to latest version 1.6.0 ([38fb7c3](https://togithub.com/googleapis/java-shared-config/commit/38fb7c3957fb6c9b2da10f9e463cc93a8b80a3a4))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox.

---

This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-orgpolicy).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzMi4xMjcuNCIsInVwZGF0ZWRJblZlciI6IjMyLjEyNy40In0=-->
github-actions bot pushed a commit that referenced this issue Aug 16, 2022
…-info-reports-plugin to v3.4.1 (#373)

[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [org.apache.maven.plugins:maven-project-info-reports-plugin](https://maven.apache.org/plugins/) | `3.4.0` -> `3.4.1` | [![age](https://badges.renovateapi.com/packages/maven/org.apache.maven.plugins:maven-project-info-reports-plugin/3.4.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/org.apache.maven.plugins:maven-project-info-reports-plugin/3.4.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/org.apache.maven.plugins:maven-project-info-reports-plugin/3.4.1/compatibility-slim/3.4.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/org.apache.maven.plugins:maven-project-info-reports-plugin/3.4.1/confidence-slim/3.4.0)](https://docs.renovatebot.com/merge-confidence/) |

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox. ⚠ **Warning**: custom changes will be lost.

---

This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-video-transcoder).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzMi4xNjAuMSIsInVwZGF0ZWRJblZlciI6IjMyLjE2MC4xIn0=-->
github-actions bot pushed a commit that referenced this issue Sep 15, 2022
🤖 I have created a release *beep* *boop*
---


### Updating meta-information for bleeding-edge SNAPSHOT release.

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
suztomo pushed a commit that referenced this issue Feb 1, 2023
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 Cloud Storage API. 🚨 This issue needs some love. triage me I really want to be triaged. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants