Skip to content

Commit

Permalink
Serialize Host Stopping Event in ActivityShim (#2178)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmrdavid authored May 13, 2022
1 parent 2f830a8 commit bcdc74b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions release_notes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
## Bug Fixes
- Correctly Serialize HostStoppingEvent in ActivityShim (https://github.com/Azure/azure-functions-durable-extension/pull/2178)
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ public override async Task<string> RunAsync(TaskContext context, string rawInput
taskEventId: this.taskEventId);

return serializedOutput;
case WrappedFunctionResult.FunctionResultStatus.FunctionsHostStoppingError:
case WrappedFunctionResult.FunctionResultStatus.FunctionsRuntimeError:
this.config.TraceHelper.FunctionAborted(
this.config.Options.HubName,
Expand Down Expand Up @@ -121,7 +122,11 @@ public override async Task<string> RunAsync(TaskContext context, string rawInput
$"Activity function '{this.activityName}' failed: {exceptionToReport.Message}",
Utils.SerializeCause(exceptionToReport, this.config.ErrorDataConverter));
default:
throw new InvalidOperationException($"{nameof(TaskActivityShim.RunAsync)} does not handle the function execution status {result.ExecutionStatus}.");
// we throw a TaskFailureException to ensure deserialization is possible.
var innerException = new Exception($"{nameof(TaskActivityShim.RunAsync)} does not handle the function execution status {result.ExecutionStatus}.");
throw new TaskFailureException(
$"Activity function '{this.activityName}' failed: {innerException}",
Utils.SerializeCause(innerException, this.config.ErrorDataConverter));
}
}

Expand Down

0 comments on commit bcdc74b

Please sign in to comment.