You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi there. I'm testing out com.google.cloud.storage.Storage.writer() for writing to GCS. It works very well for files smaller than 2GB, but right around the 2GB mark WriteChannel throws an exception indicating that there's something wrong with the Content-Range header.
com.google.api.client.http.HttpResponseException: 400|Failed to parse Content-Range header.
I noticed that the Content-Range header is set in com.google.cloud.storage.spi.DefaultStorageRpc.write() and is calculated using com.google.cloud.BaseWriteChannel.position, which is an int. The problem is that at the 2GB mark the position variable overflows and becomes negative, causing panic and mayhem.
Here are some screenshots to paint a fuller picture:
Any chance we can get a patch for this? Should I submit a pull request?
Uh very sorry for the panic and mayhem. I believe we have fixed an analogous issue for the reader and this was left behind.
A PR would be awesome, it should be as simple as making position in BaseWriteChannel a long and changing the two getters position() and getPosition() to long as well. Let me know if you can make it, otherwise I'll kick one out ASAP.
Activity
mziccard commentedon Nov 10, 2016
Uh very sorry for the panic and mayhem. I believe we have fixed an analogous issue for the reader and this was left behind.
A PR would be awesome, it should be as simple as making
positioninBaseWriteChannelalongand changing the two gettersposition()andgetPosition()to long as well. Let me know if you can make it, otherwise I'll kick one out ASAP.Dima1224 commentedon Nov 10, 2016
Can I ask you to do it? I don't have the code base checked out, was debugging against the sources jar.
mziccard commentedon Nov 10, 2016
This is kind of my job so I'll be more than happy :D
Dima1224 commentedon Nov 10, 2016
Looks like I'm talking to the right guy :)
Dima1224 commentedon Nov 11, 2016
Thanks! Any idea when the fix will be released?
mziccard commentedon Nov 11, 2016
@Dima1224 Beginning of next week the latest!
Dima1224 commentedon Nov 11, 2016
Thanks for the lightning fast turnaround once again, @mziccard! Much appreciated.
chore: Integrate new gapic-generator-java and rules_gapic (#1389)
chore(deps): update dependency com.google.cloud:google-cloud-asset to…
build(deps): bump cryptography from 39.0.1 to 41.0.2 in /.kokoro (#1389)
build(deps): update dependency org.apache.maven.plugins:maven-project…
deps: update dependency com.google.cloud:sdk-platform-java-config to …
chore(deps): update dependency com.google.cloud:google-cloud-shared-c…
build(deps): bump cryptography from 39.0.1 to 41.0.2 in /.kokoro (goo…
chore(deps): update dependency com.google.cloud:google-cloud-shared-c…
chore(main): release 2.14.1-SNAPSHOT (googleapis#1389)
build: revert maven-shade-plugin to v3.2.4 (#1389)
build: revert maven-shade-plugin to v3.2.4 (#1389)
deps: update dependency org.graalvm.buildtools:junit-platform-native …
deps: update dependency org.graalvm.buildtools:junit-platform-native …
chore: Generated snippets should not be owned by samples reviewers (g…