Repository navigation
Default DTS gRPC sends to a configurable 4 MiB limit - #847
Closed
Bernd Verst (berndverst) wants to merge 1 commit into
Closed
Bernd Verst (berndverst) wants to merge 1 commit into
Bernd Verst (berndverst) wants to merge 1 commit into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The documentation incorrectly extends the 3.9 MiB orchestrator-response check to all work-item completions and does not clarify that only null disables the MaxSendMessageSize cap.
2 open issues
What changed in this PR
Adds a configurable outbound gRPC message limit to Durable Task Scheduler clients and workers, matching DTS’s standard 4 MiB receive limit so oversized messages fail locally.
Changes:
- Defaults sends to 4 MiB per serialized message, with positive overrides or
nullfor uncapped sends. - Applies the setting when creating channels and includes it in channel cache keys.
- Adds loopback tests and configuration guidance while leaving receive limits and history chunking unchanged.
| File | Description |
|---|---|
test/Grpc.IntegrationTests/DtsGrpcSendLimitTests.cs |
Tests size boundaries, overrides, validation, and cache behavior. |
src/Worker/AzureManaged/DurableTaskSchedulerWorkerOptions.cs |
Adds and applies the worker send-limit option. |
src/Worker/AzureManaged/DurableTaskSchedulerWorkerExtensions.cs |
Includes the send limit in worker channel cache keys. |
src/Shared/AzureManaged/GrpcMessageSizeDefaults.cs |
Defines the shared 4 MiB default. |
src/Client/AzureManaged/DurableTaskSchedulerClientOptions.cs |
Adds and applies the client send-limit option. |
src/Client/AzureManaged/DurableTaskSchedulerClientExtensions.cs |
Includes the send limit in client channel cache keys. |
README.md |
Documents the default limit and configuration choices. |
Review effort: Balanced
Comment on lines
+217
to
+218
| does not change the scheduler's limits, including the 3.9 MiB limit for work-item | ||
| completion requests. |
| /// Gets or sets the maximum size, in bytes, of each outgoing gRPC message. Defaults to 4 MiB (4,194,304 bytes). | ||
| /// </summary> | ||
| /// <remarks> | ||
| /// Set to a positive value or <see langword="null"/> to disable the SDK send limit. |
Member
Author
|
We have to decided to let the server enforce the message size limit to allow future flexibility. Abandoning this PR. |
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
What changed?
MaxSendMessageSizeto a positive byte count to override it ornullto disable the SDK cap.Why is this change needed?
ResourceExhaustedinstead of being sent and then rejected by DTS.Issues / work items
Project checklist
release_notes.mdMaxSendMessageSizeor usenullto restore uncapped SDK sends.AI-assisted code disclosure (required)
Was an AI tool used? (select one)
If AI was used:
AI verification (required if AI was used):
Testing
Automated tests
dotnet test .\test\Grpc.IntegrationTests\Grpc.IntegrationTests.csproj --no-restore --filter 'FullyQualifiedName~DtsGrpcSendLimitTests|FullyQualifiedName~ClientDeadlineTests|FullyQualifiedName~LegacyChunkSize_DoesNotLimitInlineResponses' --verbosity quiet --logger 'console;verbosity=normal'Manual validation (only if runtime/behavior changed)
nullboth allow messages over the default; the channel cache respects the updated setting.DtsGrpcSendLimitTests.Notes for reviewers