Skip to content

Commit 3e62610

Browse files
author
Sophia Tevosyan
committed
fixing bug related to reacquiring the concurrent session lock unnecessarily
1 parent 1ac8877 commit 3e62610

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/DurableTask.Core/TaskOrchestrationDispatcher.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,11 @@ async Task OnProcessWorkItemSessionAsync(TaskOrchestrationWorkItem workItem)
242242
// If the provider provided work items, execute them.
243243
if (workItem.NewMessages?.Count > 0)
244244
{
245-
concurrencyLockAcquired = this.concurrentSessionLock.Acquire();
245+
// We only need to acquire the lock on the first execution within the extended session
246+
if (!concurrencyLockAcquired)
247+
{
248+
concurrencyLockAcquired = this.concurrentSessionLock.Acquire();
249+
}
246250
workItem.IsExtendedSession = concurrencyLockAcquired;
247251
// Regardless of whether or not we acquired the concurrent session lock, we will make sure to execute this work item.
248252
// If we failed to acquire it, we will end the extended session after this execution.

0 commit comments

Comments
 (0)