Skip to content

Fix error handling propagation - #188

Merged
Chris Gillum (cgillum) merged 2 commits into
mainfrom
exceptions
Sep 26, 2023
Merged

Chris Gillum (cgillum) merged 2 commits into
mainfrom
exceptions

Conversation

@cgillum

Copy link
Copy Markdown
Member

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

@bachuv Varshitha Bachu (bachuv) left a comment

Copy link
Copy Markdown
Contributor

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.

Comment thread src/DurableTask.SqlServer/DTUtils.cs
@cgillum
Chris Gillum (cgillum) merged commit 9db7c5c into main Sep 26, 2023
@cgillum
Chris Gillum (cgillum) deleted the exceptions branch September 26, 2023 00:41
@aaditya8

Copy link
Copy Markdown

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
Copy Markdown
Member Author

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