Skip to content

Commit 8fc24d9

Browse files
YunchuWangCopilot
andauthored
Update src/InProcessTestHost/Sidecar/InMemoryOrchestrationService.cs
Co-authored-by: Copilot <[email protected]>
1 parent 498508e commit 8fc24d9

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/InProcessTestHost/Sidecar/InMemoryOrchestrationService.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -756,8 +756,11 @@ public Task<OrchestrationState> WaitForInstanceAsync(string instanceId, Cancella
756756
statusRecord.OrchestrationStatus == OrchestrationStatus.Failed ||
757757
statusRecord.OrchestrationStatus == OrchestrationStatus.Terminated)
758758
{
759-
// Orchestration has already completed - complete the waiter and return
760-
tcs.TrySetResult(statusRecord);
759+
// Orchestration has already completed - complete the waiter and clean it up
760+
if (tcs.TrySetResult(statusRecord))
761+
{
762+
this.waiters.TryRemove(instanceId, out _);
763+
}
761764
}
762765
}
763766
}

0 commit comments

Comments
 (0)