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

chore(storage): fix progress call in gRPC Writer #7872

Merged
merged 2 commits into from May 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 7 additions & 5 deletions storage/grpc_client.go
Expand Up @@ -1060,11 +1060,13 @@ func (c *grpcStorageClient) OpenWriter(params *openWriterParams, opts ...storage
pr.CloseWithError(err)
return
}
// At this point, the current buffer has been uploaded. Capture the
// committed offset here in case the upload was not finalized and
// another chunk is to be uploaded.
offset = off
progress(offset)
// At this point, the current buffer has been uploaded. For resumable
// uploads, capture the committed offset here in case the upload was not
// finalized and another chunk is to be uploaded.
if gw.upid != "" {
offset = off
progress(offset)
}

// When we are done reading data and the chunk has been finalized,
// we are done.
Expand Down
2 changes: 1 addition & 1 deletion storage/integration_test.go
Expand Up @@ -2251,7 +2251,7 @@ func TestIntegration_WriterContentType(t *testing.T) {
}

func TestIntegration_WriterChunksize(t *testing.T) {
ctx := skipJSONReads(skipGRPC("https://github.com/googleapis/google-cloud-go/issues/7839"), "no reads in test")
ctx := skipJSONReads(context.Background(), "no reads in test")
multiTransportTest(ctx, t, func(t *testing.T, ctx context.Context, bucket, _ string, client *Client) {
obj := client.Bucket(bucket).Object("writer-chunksize-test" + uidSpaceObjects.New())
objSize := 1<<10<<10 + 1 // 1 Mib + 1 byte
Expand Down