Skip to content

[SQS] [Fix] Implements full support for 1MB SQS message size#9682

Merged
bpandola merged 2 commits intogetmoto:masterfrom
henryivesjones:master
Jan 30, 2026
Merged

[SQS] [Fix] Implements full support for 1MB SQS message size#9682
bpandola merged 2 commits intogetmoto:masterfrom
henryivesjones:master

Conversation

@henryivesjones
Copy link
Copy Markdown
Contributor

There is a bug in the current SQS send_message implementation that doesn't allow messages > 256KB to be sent. That limitation has been raised to 1MiB in AWS. This fix correctly sets a given queues max message size to the value set when creating the queue.

At present there are two separate places that the maximum size for an sqs message is defined. One of them contains the old value of 256KB. This value is used in a pre-check within the send_message method.

        if len(message) > MAXIMUM_MESSAGE_LENGTH:
            raise SQSException(
                "InvalidParameterValue",
                "One or more parameters are invalid. Reason: Message must be shorter than 262144 bytes.",
            )

My change consolidate that size max to a single definition and removes this pre-check. There is another check on the sqs_backend that enforces the actual size limit for the given queue. The queue model has protections on the attribute being set as well as a default value so I believe that this extra check is unnecessary.

I added a test case that would have caught this bug as well as fixed a test that referenced the 256KB limit.

@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 30, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.08%. Comparing base (47f5323) to head (ebb5dc7).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #9682   +/-   ##
=======================================
  Coverage   93.08%   93.08%           
=======================================
  Files        1302     1302           
  Lines      118298   118295    -3     
=======================================
- Hits       110114   110113    -1     
+ Misses       8184     8182    -2     
Flag Coverage Δ
servertests 28.92% <100.00%> (-0.01%) ⬇️
unittests 93.05% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Collaborator

@bpandola bpandola left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bpandola bpandola merged commit c354931 into getmoto:master Jan 30, 2026
72 checks passed
@bpandola bpandola added this to the 5.1.21 milestone Jan 30, 2026
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.

2 participants