microsoft / durabletask-mssql

Microsoft SQL storage provider for Durable Functions and the Durable Task Framework
MIT License
87 stars 31 forks source link

Fix error handling propagation #188

Closed cgillum closed 1 year ago

cgillum commented 1 year ago

Resolves https://github.com/microsoft/durabletask-mssql/issues/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:

aaditya8 commented 8 months ago

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 commented 8 months ago

@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.