microsoft / microsoft/durabletask-java

Wrap gRPC StatusRuntimeException across all client and worker gRPC calls

Abierto
#274 0 comentarios 1 reacción 2 asignados Ver en GitHub

@bachuv ya está trabajando en esto.

Desde el 7/4/2026.

  • #278 de @copilot-swe-agent — cerrado sin fusionar
Enhancement
Lenguaje dominante
Java
Estrellas
29
Forks
18
Merge medio
1 d 10 h
PR fusionados (30 d)
2

Descripción

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);
}

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.