Skip to content

fix: accept workflow work items larger than gRPC's 4MB default - #1860

Merged
dapr-bot merged 1 commit into
dapr:masterfrom
JoshVanL:fix/workflow-worker-max-receive-size
Oct 22, 2026
Merged

dapr-bot merged 1 commit into
dapr:masterfrom
JoshVanL:fix/workflow-worker-max-receive-size

Conversation

@JoshVanL

Copy link
Copy Markdown
Member

The workflow runtime builds its sidecar channel with the SDK's inbound message limit, dapr.grpc.max.inbound.message.size.bytes, which defaults to 4MB. The sidecar sends work items up to its own max body size, which apps raise for large payloads, so a work item over 4MB (for example a fan-out of five 1MB activity results) failed the GetWorkItems stream with RESOURCE_EXHAUSTED. The worker reconnected, the sidecar redelivered the same work item, and it failed again, so every workflow on the worker stalled. The history fetch after a stateful history cache miss had the same limit.

The workflow runtime builds its sidecar channel with the SDK's inbound
message limit, dapr.grpc.max.inbound.message.size.bytes, which
defaults to 4MB. The sidecar sends work items up to its own max body
size, which apps raise for large payloads, so a work item over 4MB
(for example a fan-out of five 1MB activity results) failed the
GetWorkItems stream with RESOURCE_EXHAUSTED. The worker reconnected,
the sidecar redelivered the same work item, and it failed again, so
every workflow on the worker stalled. The history fetch after a
stateful history cache miss had the same limit.

Signed-off-by: joshvanl <me@joshvanl.dev>
Copilot AI balanced review requested due to automatic review settings October 22, 2026 11:55
@JoshVanL
JoshVanL requested a review from a team as a code owner October 22, 2026 11:55
@JoshVanL
JoshVanL requested a review from a team as a code owner October 22, 2026 11:55

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

The localized override covers both affected receive paths, and the regression test targets the reported failure; tests were not executed during review.

No open issues 🎉

What changed in this PR

This PR prevents large workflow work items and fetched histories from being rejected by the worker’s default 4 MB gRPC receive limit, avoiding repeated delivery failures that stall workflows.

Changes:

  • Overrides the worker’s sidecar stub receive limit to accept messages up to Integer.MAX_VALUE.
  • Adds a TCP-based regression test that verifies processing a 6 MB activity payload through a channel configured with a 4 MB limit.
File Description
durabletask-client/​src/​test/​java/​io/​dapr/​durabletask/​DurableTaskGrpcWorkerLargeWorkItemTest.java Tests successful processing of an oversized work item.
durabletask-client/​src/​main/​java/​io/​dapr/​durabletask/​DurableTaskGrpcWorker.java Raises the receive limit for the worker’s sidecar stub.

Review effort: Balanced

@codecov

codecov Bot commented Oct 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.21%. Comparing base (3f00b25) to head (15d62d2).

Additional details and impacted files
@@            Coverage Diff            @@
##             master    #1860   +/-   ##
=========================================
  Coverage     80.21%   80.21%           
  Complexity     2801     2801           
=========================================
  Files           273      273           
  Lines          8278     8278           
  Branches        896      896           
=========================================
  Hits           6640     6640           
  Misses         1272     1272           
  Partials        366      366           

☔ View full report in Codecov by Harness.
📢 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.

@dapr-bot
dapr-bot merged commit ae6016d into dapr:master Oct 22, 2026
18 checks passed
JoshVanL added a commit that referenced this pull request Oct 22, 2026
The workflow runtime builds its sidecar channel with the SDK's inbound
message limit, dapr.grpc.max.inbound.message.size.bytes, which
defaults to 4MB. The sidecar sends work items up to its own max body
size, which apps raise for large payloads, so a work item over 4MB
(for example a fan-out of five 1MB activity results) failed the
GetWorkItems stream with RESOURCE_EXHAUSTED. The worker reconnected,
the sidecar redelivered the same work item, and it failed again, so
every workflow on the worker stalled. The history fetch after a
stateful history cache miss had the same limit.

Signed-off-by: joshvanl <me@joshvanl.dev>
(cherry picked from commit ae6016d)
Signed-off-by: joshvanl <me@joshvanl.dev>
JoshVanL added a commit that referenced this pull request Oct 22, 2026
fix: accept workflow work items larger than gRPC's 4MB default (#1860)
javier-aliaga pushed a commit that referenced this pull request Oct 22, 2026
#1865)

The workflow runtime builds its sidecar channel with the SDK's inbound
message limit, dapr.grpc.max.inbound.message.size.bytes, which
defaults to 4MB. The sidecar sends work items up to its own max body
size, which apps raise for large payloads, so a work item over 4MB
(for example a fan-out of five 1MB activity results) failed the
GetWorkItems stream with RESOURCE_EXHAUSTED. The worker reconnected,
the sidecar redelivered the same work item, and it failed again, so
every workflow on the worker stalled. The history fetch after a
stateful history cache miss had the same limit.


(cherry picked from commit ae6016d)

Signed-off-by: joshvanl <me@joshvanl.dev>
@nelson-parente nelson-parente added this to the v1.19 milestone Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants