microsoft / durabletask-java

Java SDK for Durable Functions and the Durable Task Framework
MIT License
13 stars 7 forks source link

The waitForOrchestrationStart/Complete methods should throw TimeoutException #62

Closed cgillum closed 1 year ago

cgillum commented 2 years ago

Currently these methods will raise a io.grpc.StatusRuntimeException if the timeout deadline is exceeded.

io.grpc.StatusRuntimeException: DEADLINE_EXCEEDED: deadline exceeded after 0.998280100s. [closed=[], open=[[remote_addr=/127.0.0.1:4001]]]

This is problematic because we don't want the details of gRPC to bleed out into the programming model, particularly for things that are "expected".

Instead, we should catch the gRPC exception internally, validate that it's a DEADLINE_EXCEEDED exception, and then throw a TimeoutException. This is a checked exception, which means that callers will be required to catch it.

Note that this is a breaking change and should be done before the 1.0.0 release.