Summary
Most gRPC calls in the Java SDK let raw io.grpc.StatusRuntimeException escape to callers. The .NET SDK wraps RpcException (at minimum StatusCode.Cancelled → OperationCanceledException) for all entity client methods. The Java SDK should provide consistent domain-level exception wrapping so callers don't need to depend on gRPC types and so we can have .NET feature parity.
Current Behavior
The majority of gRPC methods across DurableTaskGrpcClient, GrpcDurableEntityClient, and DurableTaskGrpcWorker let StatusRuntimeException propagate unwrapped:
DurableTaskGrpcClient — no wrapping:
suspendInstance()
resumeInstance()
terminate()
raiseEvent()
createInstanceWithRaise()
getInstanceMetadata()
DurableTaskGrpcClient — wraps specific codes only:
waitForInstanceStart() — DEADLINE_EXCEEDED → TimeoutException
waitForInstanceCompletion() — DEADLINE_EXCEEDED → TimeoutException
purgeInstances() — DEADLINE_EXCEEDED → TimeoutException
rewindInstance() — NOT_FOUND → IllegalArgumentException, FAILED_PRECONDITION → IllegalStateException
GrpcDurableEntityClient — no wrapping:
signalEntity()
getEntityMetadata()
queryEntities()
cleanEntityStorage()
DurableTaskGrpcWorker — no wrapping:
completeActivityTask()
completeOrchestratorTask()
completeEntityTask()
Expected Behavior
gRPC transport exceptions should be translated into SDK-level exceptions. At minimum:
CANCELLED → CancellationException (closest Java equivalent to .NET's OperationCanceledException)
NOT_FOUND → IllegalArgumentException or a dedicated not-found exception
DEADLINE_EXCEEDED → TimeoutException (already done for some methods)
.NET SDK Reference
The .NET GrpcDurableEntityClient wraps RpcException for every entity method:
catch (RpcException e) when (e.StatusCode == StatusCode.Cancelled)
{
throw new OperationCanceledException(
$"The {nameof(this.SignalEntityAsync)} operation was canceled.", e, cancellation);
}
Summary
Most gRPC calls in the Java SDK let raw
io.grpc.StatusRuntimeExceptionescape to callers. The .NET SDK wrapsRpcException(at minimumStatusCode.Cancelled→OperationCanceledException) for all entity client methods. The Java SDK should provide consistent domain-level exception wrapping so callers don't need to depend on gRPC types and so we can have .NET feature parity.Current Behavior
The majority of gRPC methods across
DurableTaskGrpcClient,GrpcDurableEntityClient, andDurableTaskGrpcWorkerletStatusRuntimeExceptionpropagate unwrapped:DurableTaskGrpcClient— no wrapping:suspendInstance()resumeInstance()terminate()raiseEvent()createInstanceWithRaise()getInstanceMetadata()DurableTaskGrpcClient— wraps specific codes only:waitForInstanceStart()—DEADLINE_EXCEEDED→TimeoutExceptionwaitForInstanceCompletion()—DEADLINE_EXCEEDED→TimeoutExceptionpurgeInstances()—DEADLINE_EXCEEDED→TimeoutExceptionrewindInstance()—NOT_FOUND→IllegalArgumentException,FAILED_PRECONDITION→IllegalStateExceptionGrpcDurableEntityClient— no wrapping:signalEntity()getEntityMetadata()queryEntities()cleanEntityStorage()DurableTaskGrpcWorker— no wrapping:completeActivityTask()completeOrchestratorTask()completeEntityTask()Expected Behavior
gRPC transport exceptions should be translated into SDK-level exceptions. At minimum:
CANCELLED→CancellationException(closest Java equivalent to .NET'sOperationCanceledException)NOT_FOUND→IllegalArgumentExceptionor a dedicated not-found exceptionDEADLINE_EXCEEDED→TimeoutException(already done for some methods).NET SDK Reference
The .NET
GrpcDurableEntityClientwrapsRpcExceptionfor every entity method: