`uploadFile` leaks incomplete multipart uploads on failure
- 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
Assessment
This issue has not been assessed yet.