microsoft / microsoft/durabletask-java

Wrap gRPC StatusRuntimeException across all client and worker gRPC calls

Ouverte
#274 0 commentaires 1 réaction 2 personnes assignées Voir sur GitHub

@bachuv y travaille déjà.

Depuis le 7/4/2026.

  • #278 par @copilot-swe-agent — fermée sans fusion
Enhancement
Langage dominant
Java
Étoiles
29
Forks
18
Merge moyen
1 j 10 h
PR mergées (30 j)
2

Description

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

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.