Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,14 @@
<PackageReference Include="Microsoft.ServiceFabric.Services" Version="3.3.617" />
<PackageReference Include="Microsoft.ServiceFabric" Version="6.4.617" />
<PackageReference Include="System.Collections.Immutable" Version="1.2.0" />
<PackageReference Include="Microsoft.Azure.DurableTask.Core" Version="2.13.0" />
</ItemGroup>

<!--
<ItemGroup>
<ProjectReference Include="..\DurableTask.Core\DurableTask.Core.csproj" />
</ItemGroup>
-->

<ItemGroup Condition="'$(Configuration)'=='Release'">
<Content Include="..\..\_manifest\**">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<!-- The assembly version is only the major/minor pair, making it easier to do in-place upgrades -->
<AssemblyVersion>$(MajorVersion).$(MinorVersion).0.0</AssemblyVersion>
<!-- This version is used as the nuget package version -->
<Version>$(VersionPrefix)</Version>
<Version>$(VersionPrefix)-cntasnew-1</Version>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net462'">
Expand Down
4 changes: 2 additions & 2 deletions src/DurableTask.Core/DurableTask.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<PropertyGroup>
<MajorVersion>2</MajorVersion>
<MinorVersion>13</MinorVersion>
<PatchVersion>0</PatchVersion>
<PatchVersion>1</PatchVersion>

<VersionPrefix>$(MajorVersion).$(MinorVersion).$(PatchVersion)</VersionPrefix>
<FileVersion>$(VersionPrefix).0</FileVersion>
Expand All @@ -27,7 +27,7 @@
<!-- The assembly version is only the major/minor pair, making it easier to do in-place upgrades -->
<AssemblyVersion>$(MajorVersion).$(MinorVersion).0.0</AssemblyVersion>
<!-- This version is used as the nuget package version -->
<Version>$(VersionPrefix)</Version>
<Version>$(VersionPrefix)-cntasnew-1</Version>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net462'">
Expand Down
9 changes: 6 additions & 3 deletions src/DurableTask.Core/TaskOrchestrationDispatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -805,7 +805,7 @@ bool ReconcileMessagesWithState(TaskOrchestrationWorkItem workItem)
out bool continuedAsNew)
{
ExecutionCompletedEvent executionCompletedEvent;
continuedAsNew = (completeOrchestratorAction.OrchestrationStatus == OrchestrationStatus.ContinuedAsNew);
continuedAsNew = (completeOrchestratorAction.OrchestrationStatus == OrchestrationStatus.ContinuedAsNew) && (runtimeState.OrchestrationStatus != OrchestrationStatus.Terminated);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of making a change here, I think it would be better to make a change further upstream in OrchestrationRuntimeState.SetMarkerEvents. Instead of always throwing if we see that ExecutionCompletedEvent == null, we could add an additional check that allows transitioning from a ContinuedAsNew state to the Terminated state. I feel like this is a reasonable thing to allow since termination should be considered forceful.

I'd be fine going even further than this too. I don't see a strong reason to throw an exception if multiple completion events are found as long as we can make the expected outcome predictable. Ideally we'd simply log a warning if we encounter multiple completion events. I feel like failing with an exception is only useful when we don't have a reasonable way to procede.

if (completeOrchestratorAction.OrchestrationStatus == OrchestrationStatus.ContinuedAsNew)
{
executionCompletedEvent = new ContinueAsNewEvent(completeOrchestratorAction.Id,
Expand All @@ -819,7 +819,10 @@ bool ReconcileMessagesWithState(TaskOrchestrationWorkItem workItem)
completeOrchestratorAction.FailureDetails);
}

runtimeState.AddEvent(executionCompletedEvent);
if (runtimeState.OrchestrationStatus != OrchestrationStatus.Terminated)
{
runtimeState.AddEvent(executionCompletedEvent);
}

this.logHelper.OrchestrationCompleted(runtimeState, completeOrchestratorAction);
TraceHelper.TraceInstance(
Expand Down Expand Up @@ -1076,4 +1079,4 @@ public void Release()
}
}
}
}
}