Skip to content

Commit

Permalink
Expose new ErrorPropagationMode option to allow controlling the error…
Browse files Browse the repository at this point in the history
… propagation behavior when an activity or orchestration fails with an unhandled exception (#33)

* Expose new ErrorPropagationMode option to allow controlling the error propagation behavior when an activity or orchestration fails with an unhandled exception
  • Loading branch information
joerage authored Aug 31, 2022
1 parent 344cb54 commit 4ca0433
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<!-- Azure -->
<ItemGroup>
<PackageReference Update="Microsoft.Azure.DurableTask.Core" Version="2.4.0" />
<PackageReference Update="Microsoft.Azure.DurableTask.Core" Version="2.11.0" />
<PackageReference Update="Microsoft.Azure.DurableTask.Emulator" Version="2.2.5" />
<PackageReference Update="Microsoft.Azure.DurableTask.ServiceBus" Version="2.4.0" />
</ItemGroup>
Expand Down
10 changes: 3 additions & 7 deletions releasenotes.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
# Release 2.1.6-preview
# Release 2.1.7-preview

- Fix `ObjectDisposedException` race condition during orchestration middleware
- The fix was to remove the attempt to re-use `IServiceProvider` during sessions of the same orchestration.
- The above would only impact if the DTFx orchestration/activity was registered with "Scoped" lifetime.
- Doing the above is **strongly not recommended**. It would lead to undeterministic statefulness of your orchestration or activity.
- Fixed generic type parsing to properly handle nested generics when there are multiple generic arguments.
- Fix `WrapperOrchestrationContext.IsReplaying` not properly updating.
- Upgrade to version 2.11.0 of DurableTask.Core
- Expose new ErrorPropagationMode option to allow controlling the error propagation behavior when an activity or orchestration fails with an unhandled exception
19 changes: 19 additions & 0 deletions src/DurableTask.Hosting/src/Options/TaskHubOptions.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
// Copyright (c) Jacob Viau. All rights reserved.
// Licensed under the APACHE 2.0. See LICENSE file in the project root for full license information.

using System;
using DurableTask.Core;
using DurableTask.Core.Exceptions;

namespace DurableTask.Hosting.Options
{
Expand All @@ -21,5 +23,22 @@ public class TaskHubOptions
/// <see cref="TaskActivityDispatcher.IncludeDetails"/> and <see cref="TaskOrchestrationDispatcher.IncludeDetails"/>.
/// </summary>
public IncludeDetails IncludeDetails { get; set; }

/// <summary>
/// Gets or sets the error propagation behavior when an activity or orchestration fails with an unhandled exception.
/// </summary>
/// <remarks>
/// <para>
/// Use caution when making changes to this property over the lifetime of an application. In-flight orchestrations
/// could fail unexpectedly if there is any logic that depends on a particular behavior of exception propagation.
/// For example, setting <see cref="ErrorPropagationMode.UseFailureDetails"/> causes
/// <see cref="OrchestrationException.FailureDetails"/> to be populated in <see cref="TaskFailedException"/> and
/// <see cref="SubOrchestrationFailedException"/> but also causes the <see cref="Exception.InnerException"/>
/// property to be <c>null</c> for these exception types.
/// </para><para>
/// This property must be set before the worker is started. Otherwise it will have no effect.
/// </para>
/// </remarks>
public ErrorPropagationMode ErrorPropagationMode { get; set; }
}
}
1 change: 1 addition & 0 deletions src/DurableTask.Hosting/src/TaskHubBackgroundService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public async Task StartAsync(CancellationToken cancellationToken)
_worker.TaskActivityDispatcher.IncludeDetails = Options.IncludeDetails.HasFlag(IncludeDetails.Activities);
_worker.TaskOrchestrationDispatcher.IncludeDetails = Options.IncludeDetails.HasFlag(
IncludeDetails.Orchestrations);
_worker.ErrorPropagationMode = Options.ErrorPropagationMode;
}

/// <inheritdoc />
Expand Down

0 comments on commit 4ca0433

Please sign in to comment.