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

Fix error handling propagation #188

Merged
merged 2 commits into from
Sep 26, 2023
Merged

Fix error handling propagation #188

merged 2 commits into from
Sep 26, 2023

Conversation

cgillum
Copy link
Member

@cgillum cgillum commented Sep 25, 2023

Resolves #161

For whatever reason, we forgot to fully implement exception propagation in this MSSQL backend for the Durable Task Framework. Fundamentally, the reason this is easy to miss is because the MSSQL provided doesn't serialize history events, but rather manually reads and writes them into structured SQL tables.

In this PR, we implement handling for both ErrorPropagationMode.SerializeExceptions (which we call "legacy") and ErrorPropagationMode.UseFailureDetails (which I'm treating as the new default).

To summarize the changes in this PR, we:

  • Make sure to read/write failure details to and from the database as JSON
  • Make sure we surface error details in the right way in the public API
  • Add new tests or improve existing tests to verify that we flow exception details in expected ways

@cgillum cgillum requested a review from bachuv September 25, 2023 23:28
Copy link
Contributor

@bachuv bachuv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Just left a small question.

src/DurableTask.SqlServer/DTUtils.cs Show resolved Hide resolved
@cgillum cgillum merged commit 9db7c5c into main Sep 26, 2023
2 checks passed
@cgillum cgillum deleted the exceptions branch September 26, 2023 00:41
@aaditya8
Copy link

Hi, We are waiting for this fix from so long and upgraded sqlserver libraries and core libraries and started testing with both the modes "ErrorPropagationMode.SerializeExceptions", "ErrorPropagationMode.UseFailureDetails". Please find my observations help me with my use case.

Use Case :

We have one parent orchestration , one sub orchestration under parent orchestration , one task(Activity) under sub orchestration.
I am expecting to propagate the exception occurred in sub orchestration task to both Sub orchestration and Parent orchestration. Below are my findings.

Scenarios :

  1. With SerializeExceptions : Inner Exception is always null in Sub Orchestration and Parent Orchestration.
  2. With UseFailureDetails : I am able to see the Failure details(Including stack trace) of the Sub Orchestration Activity in Sub Orchestration. Same way i am able to see the failure details of Sub Orchestration in Parent Orchestration but not able to see the Failure details of Sub orchestration activity. Its coming as null.

Could you please help me with this.

@cgillum
Copy link
Member Author

cgillum commented Mar 19, 2024

@aaditya8 please open a new issue for this and include details such as the kind of exceptions that are being raised. In that new issue, please also share code that shows how you're setting up your TaskHubWorker.

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

Successfully merging this pull request may close these issues.

Exception is not propagated to parent orchestration as expected
3 participants