Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timeout on complete when invalid task token passed #418

Open
dhiaayachi opened this issue Sep 5, 2024 · 1 comment
Open

Timeout on complete when invalid task token passed #418

dhiaayachi opened this issue Sep 5, 2024 · 1 comment

Comments

@dhiaayachi
Copy link
Owner

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

    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
Copy link
Owner Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant