You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Breaking change in WaitForExternalEvent causes external events being dropped #508
WaitForExternalEvent is called with a given event name and a cancellation token
A cancellation request is sent using the cancellation token
WaitForExternalEvent is called again with the same event name as the first call
An event with that name is raised.
Expected behavior
The latest, non-cancelled WaitForExternalEvent call will consume the event
Actual behavior
The event will be routed to the first waiter, whose task was cancelled.
Findings
In the previous version of the Durable Task SDK, the task completion sources were stored in a stack (see DurableOrchestrationContext.cs line 897), so following the above description, the new WaitForExternalEvent call's waiter would consume the event in a LIFO pattern (see DurableOrchestrationContext.cs line 951.
In the new SDK, the waiters/task completion sources are stored in a queue (see TaskOrchestrationContextWrapper.cs line 303) and the calls are processed in a FIFO pattern. Even though the task is cancelled in step 2 (line 309), the task completion source is not removed from the queue. Since the incoming events are processed in a FIFO pattern, the event is assigned to the first task completion source, which has not been removed from the queue, and is effectively lost.
This seems like an unintended breaking change, since WaitForExternalEvent now doesn't behave like the documentation suggests, when awaiting multiple events with the same name. I would greatly appreciate a fix for this issue, as it is blocker for migrating to the isolated worker model for my use case.
Activity
github-actions commentedon Mar 13, 2026
Issue Triage
Classification:
triage/already-fixedReasoning:
Closed. The WaitForExternalEvent breaking change causing dropped events has been addressed and is pending review.
Automated fix candidate: No