Repository navigation
Description
Problem
When an activity result or entity batch result exceeds the DTS service's gRPC receive limit (4 MiB by default), the service rejects CompleteActivityTask or CompleteEntityTask with ResourceExhausted: Received message exceeds the maximum configured message size. The worker never completes the work item, and the activity or entity operations re-execute indefinitely. The calling orchestration stays RUNNING with no failure surfaced.
Observed behavior against the DTS emulator:
| Case | Behavior |
|---|---|
| Activity returns 5 MiB | Activity re-executes about every 56 s; orchestration stays RUNNING |
| Five queued entity calls, each returning 1 MiB (combined batch result over 4 MiB) | All five operations re-execute about every 56 s; callers wait forever |
| One entity call returning 5 MiB | Same as above |
| Orchestration output of 5 MiB | Fails cleanly with OrchestratorResponseTooLarge (no loop) |
| Orchestration input of 5 MiB | ScheduleNewOrchestration fails immediately with ResourceExhausted (no loop) |
The poisoned work items also outlive the worker: they are redelivered to the next worker that connects.
Cause
- Only orchestration responses are bounded on the worker (about 3.9 MiB; oversized responses become a non-retriable
OrchestratorResponseTooLargefailure). Activity and entity completions are sent unchecked. isTransientWorkerGRPCStatus(client/grpc_worker.go) treatsResourceExhaustedas fatal only when the message uses gRPC-Go's local wording ("received message larger than max" / "trying to send message larger than max"). The service's wording doesn't match, so the completion RPC is retried 10 times with backoff (about 55 s), after which the worker abandons the work item (abandonActivity/abandonEntityinclient/grpc_worker_processor.go) and the service redelivers it.
#198 intentionally left activity and entity completions unchecked to match .NET. The .NET worker has the same loop (microsoft/durabletask-dotnet#848), so parity doesn't avoid it: an orchestration should never be left stuck because a completion can never be accepted.
Proposed behavior
- After large-payload externalization, check activity and entity completions against the same bound used for orchestration responses.
- Replace an oversized activity completion with a non-retriable failure (for example
ActivityResponseTooLarge), so the orchestration receivesTaskFailedand the activity isn't re-run. - Replace an oversized entity batch completion with a batch failure that omits partial state and results (for example
EntityResultTooLarge), so the calls fail and the entity state is unchanged. - Treat a service-side
ResourceExhausted"message size" rejection of a completion as non-retriable rather than transient, so it doesn't spend about 55 s in retries. - Consider exporting the new error types next to
api.ErrorTypeOrchestratorResponseTooLarge.
The in-memory test backend in durabletasktest (#183, #188) fails oversized completions on the host side so tests fail promptly; this issue tracks the worker behavior against DTS.
Activity