mirror of
https://github.com/fsouza/fake-gcs-server.git
synced 2026-04-25 13:45:52 +03:00
[GH-ISSUE #1149] Resuming a resumable upload from GCS C++ client does not work: fake-gcs-server rejects “Content-Range: bytes */*” #169
Labels
No labels
bug
compatibility-issue
docker
documentation
enhancement
help wanted
needs information
pull-request
question
stale
unfortunate
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/fake-gcs-server#169
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @QrczakMK on GitHub (May 5, 2023).
Original GitHub issue: https://github.com/fsouza/fake-gcs-server/issues/1149
When resuming a resumable upload using
gcs::RestoreResumableUploadSession(), the C++ client sendsContent-Range: bytes */*:github.com/googleapis/google-cloud-cpp@1178ef9bbb/google/cloud/storage/internal/rest_client.cc (L699)fake-gcs-server rejects this:
github.com/fsouza/fake-gcs-server@e2d2de125a/fakestorage/upload.go (L594)AFAIK this syntax is valid.
@fsouza commented on GitHub (May 6, 2023):
@QrczakMK thanks for reporting, can you give #1150 a shot?
@QrczakMK commented on GitHub (May 7, 2023):
It helps in the sense that the request syntax is no longer rejected, but a resumable upload still fails. The same test succeeds against the real GCS server.
I don’t have that test open sourced (it is in Google), but here is what happens. I begin writing to a new object with
gcs::NewResumableUploadSession():I write the first piece, capture
resumable_session_id, suspend writing, and open a new writing session withgcs::RestoreResumableUploadSession(resumable_session_id)andgcs::DisableCrc32cChecksum(true):But
gcs::ObjectWriteStream::IsOpen()isfalseandgcs::ObjectWriteStream::metadata().ok()istrue, which according to the documentation indicates that the previous upload was finished:github.com/googleapis/google-cloud-cpp@1178ef9bbb/google/cloud/storage/object_write_stream.h (L175-L192).@fsouza commented on GitHub (May 7, 2023):
Gotcha, thanks for providing additional info. I'll try to create a reproducer.
@QrczakMK commented on GitHub (May 7, 2023):
Here is a strace log of socket communication (of a similar but different run — this is a randomized test):
I am not familiar with the protocol so I am not sure what it should be there.
No data were actually written because the length did not reach 256 KiB. Still it should resume starting from 0.
I don’t have an easy comparison with a real GCS server because in that case the communication goes via https.