Azure / durabletask

Durable Task Framework allows users to write long running persistent workflows in C# using the async/await capabilities.
Apache License 2.0
1.53k stars 296 forks source link

Unimplemented locking in ActivityTaskHandler #1083

Open MarkCiliaVincenti opened 6 months ago

MarkCiliaVincenti commented 6 months ago

I've noticed that in ActivityTaskHandler there's this unused code:

        //TODO: Eventually these will need to be Redis locks once we have a multiple worker scenario
        private readonly SemaphoreSlim incomingQueueLock = new SemaphoreSlim(1);

        //TODO: This locking approach currently has a race condition that allows an activity task to be called multiple
        // times. Will likely require a somewhat substantial redesign to fix.
        private readonly ConcurrentDictionary<int, SemaphoreSlim> taskLocks;

Was there some intention to be some locking here? I can help with implementing AsyncKeyedLock here, which is used in https://github.com/Azure/apiops, https://github.com/microsoft/Vipr and https://github.com/microsoft/kiota