Open KuSh opened 1 year ago
Any news on this bug? Thanks
Looks like a super easy fix...
private ConcurrentDictionary<string, string?> cachedEnvironmentVariables = new ConcurrentDictionary<string, string?>();
private string? ReadEnvironmentVariable(string variableName)
{
return cachedEnvironmentVariables.GetOrAdd(variableName, key => this.nameResolver.Resolve(key));
}
Description
When launching multiple orchestration function at a time we often get following exception :
After digging in your source code it seems DefaultPlatformInformation.ReadEnviromentVariable function is not thread safe and can generate such exception if a thread add the variable to cachedEnviromentVariables after another thread has called TryGetValue but before it calls Add
Expected behavior
Launching multiple orchestration in a short time frame should not generate failures
Actual behavior
Orchestrator has Failed RuntimeStatus with
Orchestrator function 'analyzer' failed: One or more errors occurred. (Exception while executing function: Functions.analyzer)
OutputRelevant source code snippets
https://github.com/Azure/azure-functions-durable-extension/blob/c82b72271630741664104cefdc8c69e06b4d4aed/src/WebJobs.Extensions.DurableTask/DefaultPlatformInformation.cs#L34-L44
App Details
Screenshots
If deployed to Azure