Skip to content

[EventHub][ServiceBus] Do not announce a 1 MB max message size on pyAMQP receiver links - #50071

Open
GhostPratt wants to merge 2 commits into
Azure:mainfrom
GhostPratt:eventhub-receiver-link-max-message-size
Open

GhostPratt wants to merge 2 commits into
Azure:mainfrom
GhostPratt:eventhub-receiver-link-max-message-size

Conversation

@GhostPratt

@GhostPratt GhostPratt commented Nov 18, 2026 •

Copy link
Copy Markdown

Description

The vendored pyAMQP ReceiveClient in azure-eventhub and azure-servicebus still put a 1 MB max message size on its ATTACH frame. This switches its default to LINK_MAX_MESSAGE_SIZE (0, no limit), which the sender link has used since #43462 and #43383, so both links match. Part of #42814.

Some things worth knowing:

  • No one has reported a receive failure above 1 MB, and pyAMQP never checks incoming messages against this value, so I kept it as a consistency change. The Chronus entries are internal and don't claim a fix.
  • Sizes above 1 MB are covered by unit tests that fake the service answering with 20 MB, since the CI namespace is Standard tier and caps messages at 1 MB. The tests check what the clients pass when they create their link, plus create_batch with that 20 MB answer and the 1 MB fallback when the service sends none.
  • The new Event Hubs test files override the conftest's autouse amqpproxy fixture with a no-op. Without that they'd be skipped whenever no live Event Hub is configured.

The behavior change is the one line in each _pyamqp/client.py. The ReceiveClient.__init__ blocks of the two packages are still identical. The rest is tests and the two Chronus entries.

Still open: this hasn't run against a real dedicated cluster. #42814 asks for sending and receiving single events and batches above 1 MB, and someone with a dedicated cluster needs to check that end to end before the issue is closed.

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

…MQP receiver links

The sender link already sends 0 (no limit) since Azure#43462 and Azure#43383. Azure#42814 asks for the receiver link to match.
@azure-sdk-automation

Copy link
Copy Markdown
Contributor

The sdk-api-review-ready label cannot create a review PR for this working PR because its branch is in a fork repository. Prefer a working branch in the registered upstream repository, or reach out to the ARH maintainers for help. Fork reviews are supported through the Azure SDK CLI (azsdk apireview create), but the fork requires its own ARH registration and the review PR is created in the fork rather than the upstream repository.

@github-actions github-actions Bot added Community Contribution Community members are working on the issue customer-reported Issues that are reported by GitHub users external to the Azure organization. Event Hubs Service Bus labels Nov 18, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution GhostPratt! We will review the pull request and get back to you soon.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
7 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@GhostPratt

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues are recorded for the receiver-link default change, though dedicated-cluster validation of large-message delivery remains outstanding.

No open issues 🎉

What changed in this PR

Aligns the vendored pyAMQP receiver links in Event Hubs and Service Bus with sender links by advertising 0 (no limit) instead of 1 MB. This advances #42814; dedicated-cluster validation of large-message delivery remains outstanding.

Changes:

  • Updates receiver defaults while preserving explicit message-size overrides.
  • Adds sync/async tests for link settings and Event Hubs batch sizing with mocked 20 MB limits and the 1 MB fallback.
  • Adds internal Chronus entries for both packages.
File Description
sdk/​servicebus/​azure-servicebus/​tests/​unittests/​test_pyamqp_client_max_message_size.py Tests sync/async sender and receiver link defaults and overrides.
sdk/​servicebus/​azure-servicebus/​azure/​servicebus/​_pyamqp/​client.py Defaults receiver links to no advertised message-size limit.
sdk/​eventhub/​azure-eventhub/​tests/​unittest/​test_producer_max_message_size.py Tests negotiated batch limits, large payloads, and fallback sizing.
sdk/​eventhub/​azure-eventhub/​tests/​unittest/​asynctests/​test_producer_max_message_size_async.py Adds equivalent async batch-sizing coverage.
sdk/​eventhub/​azure-eventhub/​tests/​pyamqp_tests/​unittest/​test_client_max_message_size.py Tests sync link defaults and overrides without live-service fixtures.
sdk/​eventhub/​azure-eventhub/​tests/​pyamqp_tests/​unittest/​asynctests/​test_client_max_message_size_async.py Adds equivalent async link-setting coverage.
sdk/​eventhub/​azure-eventhub/​azure/​eventhub/​_pyamqp/​client.py Defaults receiver links to no advertised message-size limit.
.chronus/​changes/​servicebus-receiver-link-max-message-size.md Records the Service Bus consistency change as internal.
.chronus/​changes/​eventhub-receiver-link-max-message-size.md Records the Event Hubs consistency change as internal.

Review effort: Balanced

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The change looks good to me.

As a non-blocking follow-up, we could add tests that assert a literal 0 on the actual ATTACH frame, plus an explicit finite override, for both packages' sync/async receivers? The current tests mock link creation and compare against LINK_MAX_MESSAGE_SIZE, so a regression in that constant or frame construction could slip through.

… ATTACH frame

The existing tests stop at the mocked link creation and compare against LINK_MAX_MESSAGE_SIZE, so they would not catch the constant changing.
@GhostPratt

Copy link
Copy Markdown
Author

Eldert Grootenboer (@EldertGrootenboer) good point, I added it.

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

Community Contribution Community members are working on the issue customer-reported Issues that are reported by GitHub users external to the Azure organization. Event Hubs Service Bus

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants