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
14 changes: 12 additions & 2 deletions src/Shared/Grpc/ProtoUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -275,22 +275,28 @@
/// value that was provided by the corresponding <see cref="P.WorkItem"/> that triggered the orchestrator execution.
/// </param>
/// <param name="entityConversionState">The entity conversion state, or null if no conversion is required.</param>
/// <param name="orchestrationStatus">Upon completion of the method, contains the status of this orchestration.</param>
/// <param name="historyCached">Whether or not the worker has cached the orchestration history. False by default.</param>
/// <returns>The orchestrator response.</returns>
/// <exception cref="NotSupportedException">When an orchestrator action is unknown.</exception>
internal static P.OrchestratorResponse ConstructOrchestratorResponse(
string instanceId,
string? customStatus,
IEnumerable<OrchestratorAction> actions,
string completionToken,
EntityConversionState? entityConversionState)
EntityConversionState? entityConversionState,
out OrchestrationStatus orchestrationStatus,
bool historyCached = false)
{
Check.NotNull(actions);
var response = new P.OrchestratorResponse
{
InstanceId = instanceId,
CustomStatus = customStatus,
CompletionToken = completionToken,
HistoryCached = historyCached,

Check failure on line 297 in src/Shared/Grpc/ProtoUtils.cs

View workflow job for this annotation

GitHub Actions / build

'OrchestratorResponse' does not contain a definition for 'HistoryCached'

Check failure on line 297 in src/Shared/Grpc/ProtoUtils.cs

View workflow job for this annotation

GitHub Actions / build

'OrchestratorResponse' does not contain a definition for 'HistoryCached'

Check failure on line 297 in src/Shared/Grpc/ProtoUtils.cs

View workflow job for this annotation

GitHub Actions / build

'OrchestratorResponse' does not contain a definition for 'HistoryCached'

Check failure on line 297 in src/Shared/Grpc/ProtoUtils.cs

View workflow job for this annotation

GitHub Actions / build

'OrchestratorResponse' does not contain a definition for 'HistoryCached'

Check failure on line 297 in src/Shared/Grpc/ProtoUtils.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

'OrchestratorResponse' does not contain a definition for 'HistoryCached'

Check failure on line 297 in src/Shared/Grpc/ProtoUtils.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

'OrchestratorResponse' does not contain a definition for 'HistoryCached'

Check failure on line 297 in src/Shared/Grpc/ProtoUtils.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

'OrchestratorResponse' does not contain a definition for 'HistoryCached'
};
orchestrationStatus = OrchestrationStatus.Running; // default status

foreach (OrchestratorAction action in actions)
{
Expand Down Expand Up @@ -417,6 +423,7 @@
OrchestrationStatus = completeAction.OrchestrationStatus.ToProtobuf(),
Result = completeAction.Result,
};
orchestrationStatus = completeAction.OrchestrationStatus;

if (completeAction.OrchestrationStatus == OrchestrationStatus.Failed)
{
Expand Down Expand Up @@ -822,12 +829,14 @@
/// <param name="entityBatchResult">The operation result to convert.</param>
/// <param name="completionToken">The completion token, or null for the older protocol.</param>
/// <param name="operationInfos">Additional information about each operation, required by DTS.</param>
/// <param name="entityStateCached">Indicates whether the worker has cached the entity state.</param>
/// <returns>The converted operation result.</returns>
[return: NotNullIfNotNull(nameof(entityBatchResult))]
internal static P.EntityBatchResult? ToEntityBatchResult(
this EntityBatchResult? entityBatchResult,
string? completionToken = null,
IEnumerable<P.OperationInfo>? operationInfos = null)
IEnumerable<P.OperationInfo>? operationInfos = null,
bool entityStateCached = false)
{
if (entityBatchResult == null)
{
Expand All @@ -842,6 +851,7 @@
Results = { entityBatchResult.Results?.Select(a => a.ToOperationResult()) ?? [] },
CompletionToken = completionToken ?? string.Empty,
OperationInfos = { operationInfos ?? [] },
EntityStateCached = entityStateCached,

Check failure on line 854 in src/Shared/Grpc/ProtoUtils.cs

View workflow job for this annotation

GitHub Actions / build

'EntityBatchResult' does not contain a definition for 'EntityStateCached'

Check failure on line 854 in src/Shared/Grpc/ProtoUtils.cs

View workflow job for this annotation

GitHub Actions / build

'EntityBatchResult' does not contain a definition for 'EntityStateCached'

Check failure on line 854 in src/Shared/Grpc/ProtoUtils.cs

View workflow job for this annotation

GitHub Actions / build

'EntityBatchResult' does not contain a definition for 'EntityStateCached'

Check failure on line 854 in src/Shared/Grpc/ProtoUtils.cs

View workflow job for this annotation

GitHub Actions / build

'EntityBatchResult' does not contain a definition for 'EntityStateCached'

Check failure on line 854 in src/Shared/Grpc/ProtoUtils.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

'EntityBatchResult' does not contain a definition for 'EntityStateCached'

Check failure on line 854 in src/Shared/Grpc/ProtoUtils.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

'EntityBatchResult' does not contain a definition for 'EntityStateCached'

Check failure on line 854 in src/Shared/Grpc/ProtoUtils.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

'EntityBatchResult' does not contain a definition for 'EntityStateCached'
};
}

Expand Down
19 changes: 17 additions & 2 deletions src/Worker/Core/DurableTaskWorkerOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,22 @@ public DataConverter DataConverter
/// <summary>
/// Gets a value indicating whether versioning is explicitly set or not.
/// </summary>
public bool IsVersioningSet { get; internal set; }
public bool IsVersioningSet { get; internal set; }

/// <summary>
/// Gets or sets the maximum size of the orchestration history cache in bytes.
/// </summary>
public int OrchestrationHistoryCacheSizeInBytes { get; set; } = 10000;

/// <summary>
/// Gets or sets the amount of time that an orchestration history can remain in the cache before it is considered "stale" and evicted.
/// </summary>
public int OrchestrationHistoryCacheStaleEvictionTimeInMilliseconds { get; set; } = 30 * 1000; // 30 seconds

/// <summary>
/// Gets or sets how often the cache will check for stale items and evict them.
/// </summary>
public int OrchestrationHistoryCacheCheckForStaleItemsPeriodInMilliseconds { get; set; } = 5 * 1000; // 5 seconds

/// <summary>
/// Gets a value indicating whether <see cref="DataConverter" /> was explicitly set or not.
Expand All @@ -154,7 +169,7 @@ public DataConverter DataConverter
/// will <b>not</b> resolve it. If not set, we will attempt to resolve it. This is so the
/// behavior is consistently irrespective of option configuration ordering.
/// </remarks>
internal bool DataConverterExplicitlySet { get; private set; }
internal bool DataConverterExplicitlySet { get; private set; }

/// <summary>
/// Applies these option values to another.
Expand Down
Loading
Loading