Repository navigation
[DurableTask.ServiceBus] Log messages dropped by MessageSender.SendAsync when they don't fit in the batch - #1425
Open
Davide Montanari (davidemontanari) wants to merge 3 commits into
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Large dropped-ID lists are truncated by the tracing layer, leaving the intended diagnostics incomplete.
2 open issues
What changed in this PR
This PR adds visibility into messages dropped by the Service Bus provider when they exceed a single batch’s capacity, without changing the existing single-batch send behavior.
Changes:
- Adds error tracing with dropped-message counts, body bytes, IDs, and batch context.
- Disposes the message batch after use.
- Documents that messages exceeding batch capacity are traced but not sent.
| File | Description |
|---|---|
| src/DurableTask.ServiceBus/Common/Abstraction/ServiceBusAbstraction.cs | Adds overflow diagnostics, batch disposal, and method documentation. |
Review effort: Balanced
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
MessageSender.SendAsync(IEnumerable<Message>)adds every message to a singleServiceBusMessageBatchand ignores the result ofTryAddMessage. Any message that doesn't fit in the batch is never sent, and nothing records it.This PR makes these drops visible.
Changes
Errortrace is written with event typeMessageSender-SendAsync-MessagesDropped. It includes:Behaviour
Notes
All messages in one call share a single batch (256 KB on Standard, 1 MB on Premium), even though each message on its own stays below
MessageOverflowThresholdInBytes(170 KB by default). Large fan-outs can exceed the batch size: many activities scheduled in one episode, or the matching history tracking messages. When that happens, the extra messages are dropped and the new trace records them.Testing
DurableTask.ServiceBusbuilds with no warnings or errors.