Skip to content
Open
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 @@ -130,7 +130,7 @@ public Task<ITriggerData> BindAsync(object value, ValueBindingContext context)
{
// Generate a byte array which is the serialized protobuf payload
// https://developers.google.com/protocol-buffers/docs/csharptutorial#parsing_and_serialization
var entityBatchRequest = remoteContext.Request.ToEntityBatchRequest();
var entityBatchRequest = remoteContext.Request.ToEntityBatchRequest(remoteContext.Configurations);

// We convert the binary payload into a base64 string because that seems to be the most commonly supported
// format for Azure Functions language workers. Attempts to send unencoded byte[] payloads were unsuccessful.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ public Task<ITriggerData> BindAsync(object? value, ValueBindingContext context)
var orchestratorRequest = new Microsoft.DurableTask.Protobuf.OrchestratorRequest()
{
InstanceId = remoteContext.InstanceId,
PastEvents = { remoteContext.Configurations.IncludePastEvents ? remoteContext.PastEvents.Select(ProtobufUtils.ToHistoryEventProto) : Enumerable.Empty<Microsoft.DurableTask.Protobuf.HistoryEvent>() },
PastEvents = { remoteContext.Configurations.IncludeState ? remoteContext.PastEvents.Select(ProtobufUtils.ToHistoryEventProto) : Enumerable.Empty<Microsoft.DurableTask.Protobuf.HistoryEvent>() },
NewEvents = { remoteContext.NewEvents.Select(ProtobufUtils.ToHistoryEventProto) },
EntityParameters = remoteContext.EntityParameters.ToProtobuf(),
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,32 @@
using System.Collections.Generic;
using DurableTask.Core.Entities;
using DurableTask.Core.Entities.OperationFormat;
using Microsoft.Extensions.Options;
using Newtonsoft.Json;

namespace Microsoft.Azure.WebJobs.Extensions.DurableTask
{
internal class RemoteEntityContext
{
public RemoteEntityContext(EntityBatchRequest batchRequest)
public RemoteEntityContext(EntityBatchRequest batchRequest, DurableTaskOptions options, bool isExtendedSession, bool includeEntityState)
{
this.Request = batchRequest;
this.Request = batchRequest;
if (options.ExtendedSessionsEnabled)
{
this.Configurations = new RemoteInstanceConfiguration
{
IsExtendedSession = isExtendedSession,
IncludeState = includeEntityState,
ExtendedSessionIdleTimeoutInSeconds = options.ExtendedSessionIdleTimeoutInSeconds,
};
}
}

[JsonProperty("request")]
internal EntityBatchRequest Request { get; private set; }
internal EntityBatchRequest Request { get; private set; }

[JsonProperty("configurations")]
public RemoteInstanceConfiguration? Configurations { get; private set; }

[JsonIgnore]
internal EntityBatchResult? Result { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ public RemoteOrchestratorContext(OrchestrationRuntimeState runtimeState, TaskOrc
{
this.runtimeState = runtimeState ?? throw new ArgumentNullException(nameof(runtimeState));
this.EntityParameters = entityParameters;
this.Configurations = new RemoteOrchestratorConfiguration
this.Configurations = new RemoteInstanceConfiguration
{
HttpDefaultAsyncRequestSleepTimeMilliseconds = options.HttpSettings.DefaultAsyncRequestSleepTimeMilliseconds,
};
if (options.ExtendedSessionsEnabled)
{
this.Configurations.IsExtendedSession = isExtendedSession;
this.Configurations.IncludePastEvents = includePastEvents;
this.Configurations.IncludeState = includePastEvents;
this.Configurations.ExtendedSessionIdleTimeoutInSeconds = options.ExtendedSessionIdleTimeoutInSeconds;
}
}
Expand All @@ -51,7 +51,7 @@ public RemoteOrchestratorContext(OrchestrationRuntimeState runtimeState, TaskOrc
internal int UpperSchemaVersion { get; } = 4;

[JsonProperty("configurations")]
public RemoteOrchestratorConfiguration Configurations { get; private set; }
public RemoteInstanceConfiguration Configurations { get; private set; }

[JsonIgnore]
internal bool OrchestratorCompleted { get; private set; }
Expand Down
26 changes: 21 additions & 5 deletions src/WebJobs.Extensions.DurableTask/OutOfProcMiddleware.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,13 @@
}

WorkItemMetadata workItemMetadata = dispatchContext.GetProperty<WorkItemMetadata>();
bool isExtendedSession = workItemMetadata.IsExtendedSession;
bool includePastEvents = workItemMetadata.IncludePastEvents;
var context = new RemoteOrchestratorContext(
runtimeState,
entityParameters,
this.Options,
workItemMetadata.IsExtendedSession,
workItemMetadata.IncludeState);

Check failure on line 119 in src/WebJobs.Extensions.DurableTask/OutOfProcMiddleware.cs

View workflow job for this annotation

GitHub Actions / e2e-azurestorage-linux

'WorkItemMetadata' does not contain a definition for 'IncludeState' and no accessible extension method 'IncludeState' accepting a first argument of type 'WorkItemMetadata' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 119 in src/WebJobs.Extensions.DurableTask/OutOfProcMiddleware.cs

View workflow job for this annotation

GitHub Actions / e2e-azurestorage-linux

'WorkItemMetadata' does not contain a definition for 'IncludeState' and no accessible extension method 'IncludeState' accepting a first argument of type 'WorkItemMetadata' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 119 in src/WebJobs.Extensions.DurableTask/OutOfProcMiddleware.cs

View workflow job for this annotation

GitHub Actions / build

'WorkItemMetadata' does not contain a definition for 'IncludeState' and no accessible extension method 'IncludeState' accepting a first argument of type 'WorkItemMetadata' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 119 in src/WebJobs.Extensions.DurableTask/OutOfProcMiddleware.cs

View workflow job for this annotation

GitHub Actions / build

'WorkItemMetadata' does not contain a definition for 'IncludeState' and no accessible extension method 'IncludeState' accepting a first argument of type 'WorkItemMetadata' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 119 in src/WebJobs.Extensions.DurableTask/OutOfProcMiddleware.cs

View workflow job for this annotation

GitHub Actions / e2e-mssql

'WorkItemMetadata' does not contain a definition for 'IncludeState' and no accessible extension method 'IncludeState' accepting a first argument of type 'WorkItemMetadata' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 119 in src/WebJobs.Extensions.DurableTask/OutOfProcMiddleware.cs

View workflow job for this annotation

GitHub Actions / e2e-mssql

'WorkItemMetadata' does not contain a definition for 'IncludeState' and no accessible extension method 'IncludeState' accepting a first argument of type 'WorkItemMetadata' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 119 in src/WebJobs.Extensions.DurableTask/OutOfProcMiddleware.cs

View workflow job for this annotation

GitHub Actions / e2e-dts

'WorkItemMetadata' does not contain a definition for 'IncludeState' and no accessible extension method 'IncludeState' accepting a first argument of type 'WorkItemMetadata' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 119 in src/WebJobs.Extensions.DurableTask/OutOfProcMiddleware.cs

View workflow job for this annotation

GitHub Actions / e2e-dts

'WorkItemMetadata' does not contain a definition for 'IncludeState' and no accessible extension method 'IncludeState' accepting a first argument of type 'WorkItemMetadata' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 119 in src/WebJobs.Extensions.DurableTask/OutOfProcMiddleware.cs

View workflow job for this annotation

GitHub Actions / e2e-azurestorage-windows

'WorkItemMetadata' does not contain a definition for 'IncludeState' and no accessible extension method 'IncludeState' accepting a first argument of type 'WorkItemMetadata' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 119 in src/WebJobs.Extensions.DurableTask/OutOfProcMiddleware.cs

View workflow job for this annotation

GitHub Actions / e2e-azurestorage-windows

'WorkItemMetadata' does not contain a definition for 'IncludeState' and no accessible extension method 'IncludeState' accepting a first argument of type 'WorkItemMetadata' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 119 in src/WebJobs.Extensions.DurableTask/OutOfProcMiddleware.cs

View workflow job for this annotation

GitHub Actions / build

'WorkItemMetadata' does not contain a definition for 'IncludeState' and no accessible extension method 'IncludeState' accepting a first argument of type 'WorkItemMetadata' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 119 in src/WebJobs.Extensions.DurableTask/OutOfProcMiddleware.cs

View workflow job for this annotation

GitHub Actions / build

'WorkItemMetadata' does not contain a definition for 'IncludeState' and no accessible extension method 'IncludeState' accepting a first argument of type 'WorkItemMetadata' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 119 in src/WebJobs.Extensions.DurableTask/OutOfProcMiddleware.cs

View workflow job for this annotation

GitHub Actions / build

'WorkItemMetadata' does not contain a definition for 'IncludeState' and no accessible extension method 'IncludeState' accepting a first argument of type 'WorkItemMetadata' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 119 in src/WebJobs.Extensions.DurableTask/OutOfProcMiddleware.cs

View workflow job for this annotation

GitHub Actions / build

'WorkItemMetadata' does not contain a definition for 'IncludeState' and no accessible extension method 'IncludeState' accepting a first argument of type 'WorkItemMetadata' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 119 in src/WebJobs.Extensions.DurableTask/OutOfProcMiddleware.cs

View workflow job for this annotation

GitHub Actions / build

'WorkItemMetadata' does not contain a definition for 'IncludeState' and no accessible extension method 'IncludeState' accepting a first argument of type 'WorkItemMetadata' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 119 in src/WebJobs.Extensions.DurableTask/OutOfProcMiddleware.cs

View workflow job for this annotation

GitHub Actions / build

'WorkItemMetadata' does not contain a definition for 'IncludeState' and no accessible extension method 'IncludeState' accepting a first argument of type 'WorkItemMetadata' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 119 in src/WebJobs.Extensions.DurableTask/OutOfProcMiddleware.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

'WorkItemMetadata' does not contain a definition for 'IncludeState' and no accessible extension method 'IncludeState' accepting a first argument of type 'WorkItemMetadata' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 119 in src/WebJobs.Extensions.DurableTask/OutOfProcMiddleware.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

'WorkItemMetadata' does not contain a definition for 'IncludeState' and no accessible extension method 'IncludeState' accepting a first argument of type 'WorkItemMetadata' could be found (are you missing a using directive or an assembly reference?)

var context = new RemoteOrchestratorContext(runtimeState, entityParameters, this.extension.Options, isExtendedSession, includePastEvents);
bool workerRequiresHistory = false;

var input = new TriggeredFunctionData
Expand Down Expand Up @@ -351,9 +354,16 @@
batchRequest.InstanceId,
batchRequest.EntityState,
functionType: FunctionType.Entity,
isReplay: false);
isReplay: false);

WorkItemMetadata workItemMetadata = dispatchContext.GetProperty<WorkItemMetadata>();
var context = new RemoteEntityContext(
batchRequest,
this.Options,
workItemMetadata.IsExtendedSession,
workItemMetadata.IncludeState);

Check failure on line 364 in src/WebJobs.Extensions.DurableTask/OutOfProcMiddleware.cs

View workflow job for this annotation

GitHub Actions / e2e-azurestorage-linux

'WorkItemMetadata' does not contain a definition for 'IncludeState' and no accessible extension method 'IncludeState' accepting a first argument of type 'WorkItemMetadata' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 364 in src/WebJobs.Extensions.DurableTask/OutOfProcMiddleware.cs

View workflow job for this annotation

GitHub Actions / e2e-azurestorage-linux

'WorkItemMetadata' does not contain a definition for 'IncludeState' and no accessible extension method 'IncludeState' accepting a first argument of type 'WorkItemMetadata' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 364 in src/WebJobs.Extensions.DurableTask/OutOfProcMiddleware.cs

View workflow job for this annotation

GitHub Actions / build

'WorkItemMetadata' does not contain a definition for 'IncludeState' and no accessible extension method 'IncludeState' accepting a first argument of type 'WorkItemMetadata' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 364 in src/WebJobs.Extensions.DurableTask/OutOfProcMiddleware.cs

View workflow job for this annotation

GitHub Actions / build

'WorkItemMetadata' does not contain a definition for 'IncludeState' and no accessible extension method 'IncludeState' accepting a first argument of type 'WorkItemMetadata' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 364 in src/WebJobs.Extensions.DurableTask/OutOfProcMiddleware.cs

View workflow job for this annotation

GitHub Actions / e2e-mssql

'WorkItemMetadata' does not contain a definition for 'IncludeState' and no accessible extension method 'IncludeState' accepting a first argument of type 'WorkItemMetadata' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 364 in src/WebJobs.Extensions.DurableTask/OutOfProcMiddleware.cs

View workflow job for this annotation

GitHub Actions / e2e-mssql

'WorkItemMetadata' does not contain a definition for 'IncludeState' and no accessible extension method 'IncludeState' accepting a first argument of type 'WorkItemMetadata' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 364 in src/WebJobs.Extensions.DurableTask/OutOfProcMiddleware.cs

View workflow job for this annotation

GitHub Actions / e2e-dts

'WorkItemMetadata' does not contain a definition for 'IncludeState' and no accessible extension method 'IncludeState' accepting a first argument of type 'WorkItemMetadata' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 364 in src/WebJobs.Extensions.DurableTask/OutOfProcMiddleware.cs

View workflow job for this annotation

GitHub Actions / e2e-dts

'WorkItemMetadata' does not contain a definition for 'IncludeState' and no accessible extension method 'IncludeState' accepting a first argument of type 'WorkItemMetadata' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 364 in src/WebJobs.Extensions.DurableTask/OutOfProcMiddleware.cs

View workflow job for this annotation

GitHub Actions / e2e-azurestorage-windows

'WorkItemMetadata' does not contain a definition for 'IncludeState' and no accessible extension method 'IncludeState' accepting a first argument of type 'WorkItemMetadata' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 364 in src/WebJobs.Extensions.DurableTask/OutOfProcMiddleware.cs

View workflow job for this annotation

GitHub Actions / e2e-azurestorage-windows

'WorkItemMetadata' does not contain a definition for 'IncludeState' and no accessible extension method 'IncludeState' accepting a first argument of type 'WorkItemMetadata' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 364 in src/WebJobs.Extensions.DurableTask/OutOfProcMiddleware.cs

View workflow job for this annotation

GitHub Actions / build

'WorkItemMetadata' does not contain a definition for 'IncludeState' and no accessible extension method 'IncludeState' accepting a first argument of type 'WorkItemMetadata' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 364 in src/WebJobs.Extensions.DurableTask/OutOfProcMiddleware.cs

View workflow job for this annotation

GitHub Actions / build

'WorkItemMetadata' does not contain a definition for 'IncludeState' and no accessible extension method 'IncludeState' accepting a first argument of type 'WorkItemMetadata' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 364 in src/WebJobs.Extensions.DurableTask/OutOfProcMiddleware.cs

View workflow job for this annotation

GitHub Actions / build

'WorkItemMetadata' does not contain a definition for 'IncludeState' and no accessible extension method 'IncludeState' accepting a first argument of type 'WorkItemMetadata' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 364 in src/WebJobs.Extensions.DurableTask/OutOfProcMiddleware.cs

View workflow job for this annotation

GitHub Actions / build

'WorkItemMetadata' does not contain a definition for 'IncludeState' and no accessible extension method 'IncludeState' accepting a first argument of type 'WorkItemMetadata' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 364 in src/WebJobs.Extensions.DurableTask/OutOfProcMiddleware.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

'WorkItemMetadata' does not contain a definition for 'IncludeState' and no accessible extension method 'IncludeState' accepting a first argument of type 'WorkItemMetadata' could be found (are you missing a using directive or an assembly reference?)

var context = new RemoteEntityContext(batchRequest);
bool workerRequiresEntityState = false;

var input = new TriggeredFunctionData
{
Expand Down Expand Up @@ -381,6 +391,7 @@

byte[] triggerReturnValueBytes = Convert.FromBase64String(triggerReturnValue);
P.EntityBatchResult response = P.EntityBatchResult.Parser.ParseFrom(triggerReturnValueBytes);
workerRequiresEntityState = response.RequiresState;

Check failure on line 394 in src/WebJobs.Extensions.DurableTask/OutOfProcMiddleware.cs

View workflow job for this annotation

GitHub Actions / e2e-azurestorage-linux

'EntityBatchResult' does not contain a definition for 'RequiresState' and no accessible extension method 'RequiresState' accepting a first argument of type 'EntityBatchResult' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 394 in src/WebJobs.Extensions.DurableTask/OutOfProcMiddleware.cs

View workflow job for this annotation

GitHub Actions / e2e-azurestorage-linux

'EntityBatchResult' does not contain a definition for 'RequiresState' and no accessible extension method 'RequiresState' accepting a first argument of type 'EntityBatchResult' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 394 in src/WebJobs.Extensions.DurableTask/OutOfProcMiddleware.cs

View workflow job for this annotation

GitHub Actions / build

'EntityBatchResult' does not contain a definition for 'RequiresState' and no accessible extension method 'RequiresState' accepting a first argument of type 'EntityBatchResult' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 394 in src/WebJobs.Extensions.DurableTask/OutOfProcMiddleware.cs

View workflow job for this annotation

GitHub Actions / build

'EntityBatchResult' does not contain a definition for 'RequiresState' and no accessible extension method 'RequiresState' accepting a first argument of type 'EntityBatchResult' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 394 in src/WebJobs.Extensions.DurableTask/OutOfProcMiddleware.cs

View workflow job for this annotation

GitHub Actions / e2e-mssql

'EntityBatchResult' does not contain a definition for 'RequiresState' and no accessible extension method 'RequiresState' accepting a first argument of type 'EntityBatchResult' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 394 in src/WebJobs.Extensions.DurableTask/OutOfProcMiddleware.cs

View workflow job for this annotation

GitHub Actions / e2e-mssql

'EntityBatchResult' does not contain a definition for 'RequiresState' and no accessible extension method 'RequiresState' accepting a first argument of type 'EntityBatchResult' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 394 in src/WebJobs.Extensions.DurableTask/OutOfProcMiddleware.cs

View workflow job for this annotation

GitHub Actions / e2e-dts

'EntityBatchResult' does not contain a definition for 'RequiresState' and no accessible extension method 'RequiresState' accepting a first argument of type 'EntityBatchResult' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 394 in src/WebJobs.Extensions.DurableTask/OutOfProcMiddleware.cs

View workflow job for this annotation

GitHub Actions / e2e-dts

'EntityBatchResult' does not contain a definition for 'RequiresState' and no accessible extension method 'RequiresState' accepting a first argument of type 'EntityBatchResult' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 394 in src/WebJobs.Extensions.DurableTask/OutOfProcMiddleware.cs

View workflow job for this annotation

GitHub Actions / e2e-azurestorage-windows

'EntityBatchResult' does not contain a definition for 'RequiresState' and no accessible extension method 'RequiresState' accepting a first argument of type 'EntityBatchResult' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 394 in src/WebJobs.Extensions.DurableTask/OutOfProcMiddleware.cs

View workflow job for this annotation

GitHub Actions / e2e-azurestorage-windows

'EntityBatchResult' does not contain a definition for 'RequiresState' and no accessible extension method 'RequiresState' accepting a first argument of type 'EntityBatchResult' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 394 in src/WebJobs.Extensions.DurableTask/OutOfProcMiddleware.cs

View workflow job for this annotation

GitHub Actions / build

'EntityBatchResult' does not contain a definition for 'RequiresState' and no accessible extension method 'RequiresState' accepting a first argument of type 'EntityBatchResult' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 394 in src/WebJobs.Extensions.DurableTask/OutOfProcMiddleware.cs

View workflow job for this annotation

GitHub Actions / build

'EntityBatchResult' does not contain a definition for 'RequiresState' and no accessible extension method 'RequiresState' accepting a first argument of type 'EntityBatchResult' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 394 in src/WebJobs.Extensions.DurableTask/OutOfProcMiddleware.cs

View workflow job for this annotation

GitHub Actions / build

'EntityBatchResult' does not contain a definition for 'RequiresState' and no accessible extension method 'RequiresState' accepting a first argument of type 'EntityBatchResult' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 394 in src/WebJobs.Extensions.DurableTask/OutOfProcMiddleware.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

'EntityBatchResult' does not contain a definition for 'RequiresState' and no accessible extension method 'RequiresState' accepting a first argument of type 'EntityBatchResult' could be found (are you missing a using directive or an assembly reference?)
context.Result = response.ToEntityBatchResult();

context.ThrowIfFailed();
Expand Down Expand Up @@ -449,6 +460,11 @@
}

return;
}

if (workerRequiresEntityState)
{
throw new SessionAbortedException("The worker has since ended the extended session and needs an entity state to execute the request.");
}

EntityBatchResult batchResult = context.Result
Expand Down
6 changes: 4 additions & 2 deletions src/WebJobs.Extensions.DurableTask/ProtobufUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@
/// <param name="entityBatchRequest">The operation request to convert.</param>
/// <returns>The converted operation request.</returns>
[return: NotNullIfNotNull("entityBatchRequest")]
internal static P.EntityBatchRequest? ToEntityBatchRequest(this EntityBatchRequest? entityBatchRequest)
internal static P.EntityBatchRequest? ToEntityBatchRequest(this EntityBatchRequest? entityBatchRequest, RemoteInstanceConfiguration? configurations)
{
if (entityBatchRequest == null)
{
Expand All @@ -496,9 +496,11 @@
var batchRequest = new P.EntityBatchRequest()
{
InstanceId = entityBatchRequest.InstanceId,
EntityState = entityBatchRequest.EntityState,
EntityState = configurations?.IncludeState == false ? null : entityBatchRequest.EntityState,
};

batchRequest.Properties.Add(ProtobufUtils.ConvertPocoToProtoMap(configurations));

Check failure on line 502 in src/WebJobs.Extensions.DurableTask/ProtobufUtils.cs

View workflow job for this annotation

GitHub Actions / e2e-azurestorage-linux

'Extensions.Properties(IEnumerable<JObject>)' is a method, which is not valid in the given context

Check failure on line 502 in src/WebJobs.Extensions.DurableTask/ProtobufUtils.cs

View workflow job for this annotation

GitHub Actions / e2e-azurestorage-linux

'Extensions.Properties(IEnumerable<JObject>)' is a method, which is not valid in the given context

Check failure on line 502 in src/WebJobs.Extensions.DurableTask/ProtobufUtils.cs

View workflow job for this annotation

GitHub Actions / build

'Extensions.Properties(IEnumerable<JObject>)' is a method, which is not valid in the given context

Check failure on line 502 in src/WebJobs.Extensions.DurableTask/ProtobufUtils.cs

View workflow job for this annotation

GitHub Actions / build

'Extensions.Properties(IEnumerable<JObject>)' is a method, which is not valid in the given context

Check failure on line 502 in src/WebJobs.Extensions.DurableTask/ProtobufUtils.cs

View workflow job for this annotation

GitHub Actions / e2e-mssql

'Extensions.Properties(IEnumerable<JObject>)' is a method, which is not valid in the given context

Check failure on line 502 in src/WebJobs.Extensions.DurableTask/ProtobufUtils.cs

View workflow job for this annotation

GitHub Actions / e2e-mssql

'Extensions.Properties(IEnumerable<JObject>)' is a method, which is not valid in the given context

Check failure on line 502 in src/WebJobs.Extensions.DurableTask/ProtobufUtils.cs

View workflow job for this annotation

GitHub Actions / e2e-dts

'Extensions.Properties(IEnumerable<JObject>)' is a method, which is not valid in the given context

Check failure on line 502 in src/WebJobs.Extensions.DurableTask/ProtobufUtils.cs

View workflow job for this annotation

GitHub Actions / e2e-dts

'Extensions.Properties(IEnumerable<JObject>)' is a method, which is not valid in the given context

Check failure on line 502 in src/WebJobs.Extensions.DurableTask/ProtobufUtils.cs

View workflow job for this annotation

GitHub Actions / e2e-azurestorage-windows

'Extensions.Properties(IEnumerable<JObject>)' is a method, which is not valid in the given context

Check failure on line 502 in src/WebJobs.Extensions.DurableTask/ProtobufUtils.cs

View workflow job for this annotation

GitHub Actions / e2e-azurestorage-windows

'Extensions.Properties(IEnumerable<JObject>)' is a method, which is not valid in the given context

Check failure on line 502 in src/WebJobs.Extensions.DurableTask/ProtobufUtils.cs

View workflow job for this annotation

GitHub Actions / build

'Extensions.Properties(IEnumerable<JObject>)' is a method, which is not valid in the given context

Check failure on line 502 in src/WebJobs.Extensions.DurableTask/ProtobufUtils.cs

View workflow job for this annotation

GitHub Actions / build

'Extensions.Properties(IEnumerable<JObject>)' is a method, which is not valid in the given context

Check failure on line 502 in src/WebJobs.Extensions.DurableTask/ProtobufUtils.cs

View workflow job for this annotation

GitHub Actions / build

'Extensions.Properties(IEnumerable<JObject>)' is a method, which is not valid in the given context

Check failure on line 502 in src/WebJobs.Extensions.DurableTask/ProtobufUtils.cs

View workflow job for this annotation

GitHub Actions / build

'Extensions.Properties(IEnumerable<JObject>)' is a method, which is not valid in the given context

Check failure on line 502 in src/WebJobs.Extensions.DurableTask/ProtobufUtils.cs

View workflow job for this annotation

GitHub Actions / build

'Extensions.Properties(IEnumerable<JObject>)' is a method, which is not valid in the given context

Check failure on line 502 in src/WebJobs.Extensions.DurableTask/ProtobufUtils.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

'Extensions.Properties(IEnumerable<JObject>)' is a method, which is not valid in the given context

Check failure on line 502 in src/WebJobs.Extensions.DurableTask/ProtobufUtils.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

'Extensions.Properties(IEnumerable<JObject>)' is a method, which is not valid in the given context

foreach (var operation in entityBatchRequest.Operations ?? Enumerable.Empty<OperationRequest>())
{
batchRequest.Operations.Add(operation.ToOperationRequest());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,31 @@
namespace Microsoft.Azure.WebJobs.Extensions.DurableTask
{
/// <summary>
/// Configuration settings for RemoteOrchestratorContext in out-of-process mode, transmitted via gRPC.
/// Configuration settings for <see cref="RemoteOrchestratorContext"> and <see cref="RemoteEntityContext">
/// in out-of-process mode, transmitted via gRPC.
/// </summary>
public class RemoteOrchestratorConfiguration
internal class RemoteInstanceConfiguration
{
/// <summary>
/// Gets or sets the default number of milliseconds between async HTTP status poll requests.
/// </summary>
public int HttpDefaultAsyncRequestSleepTimeMilliseconds { get; set; } = 30000;
internal int HttpDefaultAsyncRequestSleepTimeMilliseconds { get; set; } = 30000;

/// <summary>
/// Gets or sets whether or not to include the past history events in the orchestration request.
/// Gets or sets whether or not to include the instance state in the instance request.
/// True by default.
/// </summary>
public bool IncludePastEvents { get; set; } = true;
internal bool IncludeState { get; set; } = true;

/// <summary>
/// Gets or sets whether or not the orchestration request is within an extended session.
/// False by default.
/// </summary>
public bool IsExtendedSession { get; set; } = false;
internal bool IsExtendedSession { get; set; } = false;

/// <summary>
/// Gets or sets the amount of time in seconds before an idle extended session times out.
/// </summary>
public int ExtendedSessionIdleTimeoutInSeconds { get; set; }
internal int ExtendedSessionIdleTimeoutInSeconds { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ private async ValueTask RunEntityAsync(FunctionContext context, BindingMetadata
return;
}

TaskEntityDispatcher dispatcher = new(encodedEntityBatch, context.InstanceServices);
TaskEntityDispatcher dispatcher = new(encodedEntityBatch, context.InstanceServices, extendedSessionsCache);
triggerInputData.Value = dispatcher;
await inner.ExecuteAsync(context);
context.GetInvocationResult().Value = dispatcher.Result;
Expand Down
8 changes: 6 additions & 2 deletions src/Worker.Extensions.DurableTask/TaskEntityDispatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
using System;
using System.Threading.Tasks;
using Microsoft.DurableTask.Entities;
using Microsoft.DurableTask.Worker;
using Microsoft.DurableTask.Worker.Grpc;
using Microsoft.Extensions.Caching.Memory;
using Microsoft.Extensions.DependencyInjection;

namespace Microsoft.Azure.Functions.Worker;
Expand All @@ -19,11 +21,13 @@
{
private readonly string request;
private readonly IServiceProvider services;
private readonly ExtendedSessionsCache extendedSessionsCache;

internal TaskEntityDispatcher(string request, IServiceProvider services)
internal TaskEntityDispatcher(string request, IServiceProvider services, ExtendedSessionsCache extendedSessionsCache)
{
this.request = request;
this.services = services;
this.extendedSessionsCache = extendedSessionsCache;
}

internal string Result { get; private set; } = string.Empty;
Expand All @@ -40,7 +44,7 @@
throw new ArgumentNullException(nameof(entity));
}

this.Result = await GrpcEntityRunner.LoadAndRunAsync(this.request, entity, this.services);
this.Result = await GrpcEntityRunner.LoadAndRunAsync(this.request, entity, this.extendedSessionsCache, this.services);

Check failure on line 47 in src/Worker.Extensions.DurableTask/TaskEntityDispatcher.cs

View workflow job for this annotation

GitHub Actions / build

No overload for method 'LoadAndRunAsync' takes 4 arguments

Check failure on line 47 in src/Worker.Extensions.DurableTask/TaskEntityDispatcher.cs

View workflow job for this annotation

GitHub Actions / build

No overload for method 'LoadAndRunAsync' takes 4 arguments

Check failure on line 47 in src/Worker.Extensions.DurableTask/TaskEntityDispatcher.cs

View workflow job for this annotation

GitHub Actions / build

No overload for method 'LoadAndRunAsync' takes 4 arguments

Check failure on line 47 in src/Worker.Extensions.DurableTask/TaskEntityDispatcher.cs

View workflow job for this annotation

GitHub Actions / build

No overload for method 'LoadAndRunAsync' takes 4 arguments

Check failure on line 47 in src/Worker.Extensions.DurableTask/TaskEntityDispatcher.cs

View workflow job for this annotation

GitHub Actions / build

No overload for method 'LoadAndRunAsync' takes 4 arguments

Check failure on line 47 in src/Worker.Extensions.DurableTask/TaskEntityDispatcher.cs

View workflow job for this annotation

GitHub Actions / build

No overload for method 'LoadAndRunAsync' takes 4 arguments

Check failure on line 47 in src/Worker.Extensions.DurableTask/TaskEntityDispatcher.cs

View workflow job for this annotation

GitHub Actions / build

No overload for method 'LoadAndRunAsync' takes 4 arguments

Check failure on line 47 in src/Worker.Extensions.DurableTask/TaskEntityDispatcher.cs

View workflow job for this annotation

GitHub Actions / build

No overload for method 'LoadAndRunAsync' takes 4 arguments

Check failure on line 47 in src/Worker.Extensions.DurableTask/TaskEntityDispatcher.cs

View workflow job for this annotation

GitHub Actions / build

No overload for method 'LoadAndRunAsync' takes 4 arguments

Check failure on line 47 in src/Worker.Extensions.DurableTask/TaskEntityDispatcher.cs

View workflow job for this annotation

GitHub Actions / build

No overload for method 'LoadAndRunAsync' takes 4 arguments

Check failure on line 47 in src/Worker.Extensions.DurableTask/TaskEntityDispatcher.cs

View workflow job for this annotation

GitHub Actions / build

No overload for method 'LoadAndRunAsync' takes 4 arguments

Check failure on line 47 in src/Worker.Extensions.DurableTask/TaskEntityDispatcher.cs

View workflow job for this annotation

GitHub Actions / build

No overload for method 'LoadAndRunAsync' takes 4 arguments

Check failure on line 47 in src/Worker.Extensions.DurableTask/TaskEntityDispatcher.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

No overload for method 'LoadAndRunAsync' takes 4 arguments

Check failure on line 47 in src/Worker.Extensions.DurableTask/TaskEntityDispatcher.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

No overload for method 'LoadAndRunAsync' takes 4 arguments

Check failure on line 47 in src/Worker.Extensions.DurableTask/TaskEntityDispatcher.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

No overload for method 'LoadAndRunAsync' takes 4 arguments

Check failure on line 47 in src/Worker.Extensions.DurableTask/TaskEntityDispatcher.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

No overload for method 'LoadAndRunAsync' takes 4 arguments
}

/// <summary>
Expand Down
Loading