You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Extended Sessions for Isolated (Orchestrations) (#449)
* updated to use c# built in memory cache
* fixed bug where new events were not cleared
* added a new field to the OrchestratorResponse, restored the old public facing method without the extended sessions parameter
* removed unused ExtendedSessions object
* fixing line endings
* added comments to the ExtendedSessionState class and the memory cache import to props
* fixing props line endings
* added a wrapper ExtendedSessionsCache object
* added comments
* updated the expiration scan frequency
* addressing some comments
* fixing indentation
* adding proto files
* added a max frequency to cache scan expiration
* reverting to old implementation without a max
* addressing comments
* adding updated protos
* added null check
* missed an earlier PR comment
* added the durabletask packages from the test source
* updated reference to new preview package
* pushing the updated yml
* forgot to update the release package name
* adding unit tests
* had the wrong default timeout
* fixed failing test
* adding new dependencies and new package number
* pushing bug fix for not honoring a host restarting an extended session
* updating version numbers
* added proto changes from main branch
* downgrading the cache package to a version that is test with net6.0
* reverting ci changes
* adding caching package
* addressing PR comments
* missed one file
* had a mistake in the LoadAndRun path
* slight update to extended session parameter name
* slight change to avoid unnecessary initialization of the cache if properties are not specified, also added another test to make sure that extended sessions aren't stored if isExtendedSessions is false
* slight change to make the idle timeout need to be >0 rather than >=0
* updating version numbers and protos
---------
Co-authored-by: Sophia Tevosyan <[email protected]>
/// Deserializes orchestration history from <paramref name="encodedOrchestratorRequest"/> and uses it to resume the
92
+
/// orchestrator implemented by <paramref name="implementation"/>.
93
+
/// </summary>
94
+
/// <param name="encodedOrchestratorRequest">
95
+
/// The encoded protobuf payload representing an orchestration execution request. This is a base64-encoded string.
96
+
/// </param>
97
+
/// <param name="implementation">
98
+
/// An <see cref="ITaskOrchestrator"/> implementation that defines the orchestrator logic.
99
+
/// </param>
100
+
/// <param name="extendedSessionsCache">
101
+
/// The cache of extended sessions which can be used to retrieve the <see cref="ExtendedSessionState"/> if this orchestration request is from within an extended session.
102
+
/// </param>
103
+
/// <param name="services">
104
+
/// Optional <see cref="IServiceProvider"/> from which injected dependencies can be retrieved.
105
+
/// </param>
106
+
/// <returns>
107
+
/// Returns a serialized set of orchestrator actions that should be used as the return value of the orchestrator function trigger.
108
+
/// </returns>
109
+
/// <exception cref="ArgumentNullException">
110
+
/// Thrown if <paramref name="encodedOrchestratorRequest"/> or <paramref name="implementation"/> is <c>null</c>.
111
+
/// </exception>
112
+
/// <exception cref="ArgumentException">
113
+
/// Thrown if <paramref name="encodedOrchestratorRequest"/> contains invalid data.
114
+
/// </exception>
115
+
publicstaticstringLoadAndRun(
116
+
stringencodedOrchestratorRequest,
117
+
ITaskOrchestratorimplementation,
118
+
ExtendedSessionsCache?extendedSessionsCache,
119
+
IServiceProvider?services=null)
85
120
{
86
121
Check.NotNullOrEmpty(encodedOrchestratorRequest);
87
122
Check.NotNull(implementation);
@@ -95,34 +130,114 @@ public static string LoadAndRun(
// If a history was provided, even if we already have an extended session stored, we always want to evict whatever state is in the cache and replace it with a new extended
164
+
// session based on the provided history
165
+
if(!pastEventsIncluded&&extendedSessions.TryGetValue(request.InstanceId,outExtendedSessionState?extendedSessionState)&&extendedSessionStateis not null)
0 commit comments