Plug leak in handleCompleteMultipartUpload

In jclouds 2.6.0 BlobStore.getBlob returns an InputStream instead of a
ByteSource for the filesystem.  Previously the call site leaked the
former since it only consumed the BlobMetadata.  Instead call
BlobStore.blobMedata which does not include the payload.
Fixes JCLOUDS-1626.
pull/617/head
Andrew Gaul 2024-03-03 13:09:30 +09:00
rodzic b147909ff3
commit ec12ae0fe5
1 zmienionych plików z 2 dodań i 1 usunięć

Wyświetl plik

@ -2253,7 +2253,7 @@ public class S3ProxyHandler {
PutOptions options;
if (Quirks.MULTIPART_REQUIRES_STUB.contains(getBlobStoreType(
blobStore))) {
metadata = blobStore.getBlob(containerName, uploadId).getMetadata();
metadata = blobStore.blobMetadata(containerName, uploadId);
BlobAccess access = blobStore.getBlobAccess(containerName,
uploadId);
options = new PutOptions().setBlobAccess(access);
@ -2632,6 +2632,7 @@ public class S3ProxyHandler {
blobName, uploadId, createFakeBlobMetadata(blobStore),
new PutOptions());
// TODO: Blob can leak on precondition failures.
Blob blob = blobStore.getBlob(sourceContainerName, sourceBlobName,
options);
if (blob == null) {