microsoft / microsoft/durabletask-java

Wrap gRPC StatusRuntimeException across all client and worker gRPC calls

Đang mở
#274 0 bình luận 1 reaction 2 người được giao Xem trên GitHub

@bachuv đang làm issue này rồi.

Từ ngày 7/4/2026.

  • #278 của @copilot-swe-agent — đã đóng, không merge
Enhancement
Ngôn ngữ chính
Java
Star
29
Fork
18
Merge trung bình
1 ngày 10 giờ
Pull request đã merge (30 ngày)
2

Mô tả

Summary

Most gRPC calls in the Java SDK let raw io.grpc.StatusRuntimeException escape to callers. The .NET SDK wraps RpcException (at minimum StatusCode.CancelledOperationCanceledException) 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_EXCEEDEDTimeoutException
  • waitForInstanceCompletion()DEADLINE_EXCEEDEDTimeoutException
  • purgeInstances()DEADLINE_EXCEEDEDTimeoutException
  • rewindInstance()NOT_FOUNDIllegalArgumentException, FAILED_PRECONDITIONIllegalStateException

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:

  • CANCELLEDCancellationException (closest Java equivalent to .NET's OperationCanceledException)
  • NOT_FOUNDIllegalArgumentException or a dedicated not-found exception
  • DEADLINE_EXCEEDEDTimeoutException (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);
}

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.