Open
Conversation
gocloud.dev's SQS driver batches Send() calls internally via SendMessageBatch (up to 10 messages) but does not enforce SQS's 1 MB batch size limit. When log entries carry large payloads the batch can exceed 1 MB, causing SQS to reject the entire batch. This cascades into a permanent retry loop because the log entry never gets persisted and the retry scheduler cannot find a prior attempt. Set MaxBatchByteSize to 1 MB so gocloud splits oversized batches before they reach SQS. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
971064b to
ebe2e42
Compare
alexbouchardd
approved these changes
Apr 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
gocloud.dev's SQS topic driver batches
Send()calls viaSendMessageBatch(up to 10 messages per batch) but does not enforce SQS's 1 MB total batch size limit — it relies on SQS to reject oversized batches at the API level.When log entries carry large payloads (e.g., large request/response bodies), the combined batch can exceed 1 MB, causing SQS to reject the entire batch with
BatchRequestTooLong. This failure cascades: the log entry never gets persisted, and the retry scheduler can't find a prior attempt in the logstore, triggering an infinite retry loop (see #663).This PR sets
MaxBatchByteSize: 1_048_576on the gocloudTopicOptionsso the batcher splits oversized batches before they reach SQS. If a single message exceeds 1 MB, gocloud returnsErrMessageTooLargeinstead of a cryptic SQS batch error.Changes
TopicOptionswithBatcherOptions.MaxBatchByteSizeset to 1 MB when opening SQS topics inqueue_awssqs.goTest plan
🤖 Generated with Claude Code