-
Notifications
You must be signed in to change notification settings - Fork 273
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
Improve exception handling in .NET isolated #3034
base: dev
Are you sure you want to change the base?
Conversation
- Serialize exception details in worker middleware - Attempt to deserialize in host middleware - Ensure inner exceptions + complex messages are preserved
|
||
var orchestrationDetails = await DurableHelpers.GetRunningOrchestrationDetailsAsync(statusQueryGetUri); | ||
Assert.StartsWith("Microsoft.DurableTask.TaskFailedException", orchestrationDetails.Output); | ||
Assert.Contains("This activity failed", orchestrationDetails.Output); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there anything more we can validate here? For example, the type of the inner exception?
|
||
public override string? StackTrace => this.FromException.StackTrace; | ||
|
||
private static TaskFailureDetails? ExceptionToTaskFailureDetailsRecursive(Exception? fromException) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have a shared version of this we can use? Or is it in some inaccessible place, so we have to copy it? I'm a tiny bit worried about keeping multiple copies up-to-date if we decide to add richer information to TaskFailureDetails
(which is very likely).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved to a new TaskFailureDetailsConverter
catch (Exception ex) | ||
{ | ||
throw new DurableSerializationException(ex); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be beneficial to catch and do this for orchestration and entity triggers as well?
Improves exception handling in .NET isolated by serializing the exception details in the worker middleware, then deserializing them back in host middleware.
This may introduce breaking changes to the way that the Functions Host logs exceptions from Durable activities.
Also adds testing for error handling, activity retry, and activity timeout scenarios in dotnet-isolated
Resolves #2711
Pull request checklist
pending_docs.md
release_notes.md
/src/Worker.Extensions.DurableTask/AssemblyInfo.cs
dev
andmain
branches and will not be merged into thev2.x
branch.