dhiaayachi / temporal

Temporal service
https://docs.temporal.io
MIT License
0 stars 0 forks source link

Timeout on complete when invalid task token passed #418

Open dhiaayachi opened 2 months ago

dhiaayachi commented 2 months ago

Expected Behavior

The client should throw an exception immidiatley

Actual Behavior

Calling activityCompletionClient.complete with an invalid task token, gives a timeout after a while instead of an error.

Steps to Reproduce the Problem

1.

    workflowClient.newActivityCompletionClient().complete(
        "bogus".toByteArray(), ""
    )
  1. Timeout occurs after a while with the following exception: Caused by: io.grpc.StatusRuntimeException: UNKNOWN: unexpected EOF

Specifications

dhiaayachi commented 2 months ago

Thanks for reporting this! The issue you are experiencing is indeed a known problem, and we're working on a fix for a future release. This is because the ActivityCompletionClient is asynchronous and will not throw exceptions until the complete or completeExceptionally method is actually called. You can access the ActivityCompletionClient's error property to check for errors.

Until the fix is available, you can use a try-catch block to handle errors in an Activity. This might look like:

try:
    workflowClient.newActivityCompletionClient().complete(
        "bogus".toByteArray(), ""
    )
except Exception as e:
    print(f"Activity Completion Client error: {e}")