Skip to content

Commit e8c6d95

Browse files
authored
Fix handling of empty multipart uploads for GCS (#5590)
* Fix handling of empty multipart uploads for GCS * Clippy
1 parent 1b0ef02 commit e8c6d95

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

object_store/src/gcp/client.rs

+7
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,13 @@ impl GoogleCloudStorageClient {
430430
multipart_id: &MultipartId,
431431
completed_parts: Vec<PartId>,
432432
) -> Result<PutResult> {
433+
if completed_parts.is_empty() {
434+
// GCS doesn't allow empty multipart uploads
435+
let result = self.put_request(path, Default::default()).send().await?;
436+
self.multipart_cleanup(path, multipart_id).await?;
437+
return Ok(result);
438+
}
439+
433440
let upload_id = multipart_id.clone();
434441
let url = self.object_url(path);
435442

0 commit comments

Comments
 (0)