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

[Workflow] try/except not working correctly in workflow functions #627

Closed
cgillum opened this issue Oct 28, 2023 · 3 comments · Fixed by #634
Closed

[Workflow] try/except not working correctly in workflow functions #627

cgillum opened this issue Oct 28, 2023 · 3 comments · Fixed by #634
Labels
kind/bug Something isn't working waiting for external dependency depends on an external dependency that requires a release or fix

Comments

@cgillum
Copy link
Contributor

cgillum commented Oct 28, 2023

Expected Behavior

Consider the following logic inside a workflow:

try:
    yield ctx.call_activity(submit_order_to_shipping, input=order)
except Exception as e:
    # Shipping failed, so we need to refund the payment
    yield ctx.call_activity(notify, input=f"Error submitting order for shipping: {str(e)}")
    yield ctx.call_activity(refund_payment, input=order)

If the submit_order_to_shipping activity fails, one would expect both the notify and refund_payment activities to run inside the except block.

Actual Behavior

However, as of the 0.2.0 workflow extension release, only the notify activity executes, and then the workflow fails.

The root cause is a bug in the Durable Task Python SDK: microsoft/durabletask-python#20

Steps to Reproduce the Problem

Write a workflow where an activity failure triggers logic in an except block and tries to perform multiple steps inside the catch block.

Release Note

RELEASE NOTE: FIX try/except not working correctly in workflow functions

@cgillum cgillum added the kind/bug Something isn't working label Oct 28, 2023
@cgillum
Copy link
Contributor Author

cgillum commented Oct 30, 2023

FYI @DeepanshuA @XavierGeerinck

@berndverst berndverst added the waiting for external dependency depends on an external dependency that requires a release or fix label Oct 31, 2023
@berndverst
Copy link
Member

Not actionable until microsoft/durabletask-python#20 is fixed.

@berndverst berndverst added this to the v1.13 milestone Oct 31, 2023
@DeepanshuA
Copy link
Contributor

seems microsoft/durabletask-python#21 is merged, so yeah will do dapr-py change to accomodate that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working waiting for external dependency depends on an external dependency that requires a release or fix
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants