mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
.NET: Fix intermittent checkpoint-restore race in in-process workflow runs (#5134)
* Improve workflow unit tests * Update test name prefix for clarity. * Update tests to surface any errors. * fix check-point restore-time race in off-thread workflow event stream * Fixes an intermittent checkpoint-restore race in in-process workflow runs.
This commit is contained in:
@@ -419,6 +419,12 @@ internal sealed class InProcessRunnerContext : IRunnerContext
|
||||
.Select(id => this.EnsureExecutorAsync(id, tracer: null).AsTask())
|
||||
.ToArray();
|
||||
|
||||
// Discard queued external deliveries from the superseded timeline so a runtime
|
||||
// restore cannot apply stale responses after importing the checkpoint state.
|
||||
while (this._queuedExternalDeliveries.TryDequeue(out _))
|
||||
{
|
||||
}
|
||||
|
||||
this._nextStep = new StepContext();
|
||||
this._nextStep.ImportMessages(importedState.QueuedMessages);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user