Skip to content

fix(aws_s3_stream): retry part uploads triggered by max_buffer_period - #1192

Open
pcbeingused333 wants to merge 1 commit into
warpstreamlabs:mainfrom
pcbeingused333:fix/s3-stream-timer-retry
Open

pcbeingused333 wants to merge 1 commit into
warpstreamlabs:mainfrom
pcbeingused333:fix/s3-stream-timer-retry

Conversation

@pcbeingused333

Copy link
Copy Markdown
Contributor

Root cause
When a buffer of at least 5 MiB sits for longer than max_buffer_period, the timer uploads it with forceFlush. That makes a single UploadPart attempt with no backoff, and on failure it aborts the multipart upload. The returned error is discarded, so the buffered data of already-acknowledged messages is lost with the aborted upload, and the writer keeps the dead upload ID.

Fix
The timer path now calls flush, the same routine the size and count triggers use: it retries the same part number with the configured backoff and only aborts once retries are exhausted. forceFlush is now only used for the final part in Close.

What happens after all retries fail is unchanged (the upload is still aborted, and the timer path has no caller to report to).

Tests
Added TestS3StreamingWriterTimerFlushRetriesFailedPart, where the first timer-triggered UploadPart fails. Before the change the upload is aborted; after it, part 1 is retried and the upload completes with no abort. The S3StreamingWriter unit tests and go vet on the package pass. Integration tests and make lint were not run. CHANGELOG updated.

This contribution was prepared with the assistance of an AI coding tool (Claude Code).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant