hashgraph / hashgraph/bucky

`uploadFile` leaks incomplete multipart uploads on failure

Open
#12 0 comments 0 reactions 0 assignees View on GitHub
Bug
Dominant language
Java
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

### 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` 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.java` — `uploadFile()` method (~line 286)

### Additional context

_No response_

### Hedera network

_No response_

### Version

v0.1.0

### Operating system

None

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.