From cfb0593ee955cdcf68d23f8ef3c3050f397b8ede Mon Sep 17 00:00:00 2001 From: Chris Gillum Date: Wed, 1 Dec 2021 12:34:47 -0800 Subject: [PATCH] Fix compatibility issue between older clients and newer workers on DT.AzureStorage (#651) --- src/DurableTask.AzureStorage/OrchestrationSessionManager.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/DurableTask.AzureStorage/OrchestrationSessionManager.cs b/src/DurableTask.AzureStorage/OrchestrationSessionManager.cs index 9f04e3290..07c3b085f 100644 --- a/src/DurableTask.AzureStorage/OrchestrationSessionManager.cs +++ b/src/DurableTask.AzureStorage/OrchestrationSessionManager.cs @@ -236,9 +236,10 @@ async Task> DedupeExecutionStartedMessagesAsync( { OrchestrationInstance localInstance = message.TaskMessage.OrchestrationInstance; if (remoteOrchestrationsById.TryGetValue(localInstance.InstanceId, out OrchestrationState remoteInstance) && - string.Equals(localInstance.ExecutionId, remoteInstance.OrchestrationInstance.ExecutionId, StringComparison.OrdinalIgnoreCase)) + (remoteInstance.OrchestrationInstance.ExecutionId == null || string.Equals(localInstance.ExecutionId, remoteInstance.OrchestrationInstance.ExecutionId, StringComparison.OrdinalIgnoreCase))) { - // Happy path: The message matches the table status. Allow it to run. + // Happy path: The message matches the table status. Alternatively, if the table doesn't have an ExecutionId field (older clients, pre-v1.8.5), + // then we have no way of knowing if it's a duplicate. Either way, allow it to run. } else if (this.IsScheduledAfterInstanceUpdate(message, remoteInstance)) {