Skip to content

uploadFile leaks incomplete multipart uploads on failure #12

@Nana-EC

Description

@Nana-EC

Description

S3Client.uploadFile() starts a multipart upload with createMultipartUpload() but has no
error handling around the subsequent multipartUploadPart() or completeMultipartUpload()
calls. If any part upload or the completion step throws an exception, the multipart upload is
abandoned in S3 without being aborted. AWS charges for the storage consumed by incomplete
multipart uploads until they are explicitly aborted.

Steps to reproduce

  1. Call uploadFile() with an Iterator<byte[]> that throws mid-iteration (or simulate a
    network failure during a part upload).
  2. Observe that the incomplete multipart upload remains listed under listMultipartUploads().
  3. Note that S3/MinIO continues to hold the uploaded bytes in staging storage.

Expected behavior
If any step after createMultipartUpload() fails, abortMultipartUpload() should be called
in a finally or catch block before the exception propagates to the caller.

Actual behavior
The upload ID is silently leaked. The partial upload persists until manually aborted.

Affected file
client/src/main/java/com/hedera/bucky/S3Client.javauploadFile() method (~line 286)

Additional context

No response

Hedera network

No response

Version

v0.1.0

Operating system

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA error that causes the feature to behave differently than what was expected based on design docs

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions