.NET: fix: Sporadic failure of Checkpoint Restore with PendingRequests tests#5086
Open
.NET: fix: Sporadic failure of Checkpoint Restore with PendingRequests tests#5086
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes a timing/epoch synchronization issue during checkpoint restore when there are pending external requests, which was causing sporadic early termination of event streaming and flaky tests in the workflows runtime.
Changes:
- Adjusts
StreamingRunEventStream.TakeEventStreamAsyncepoch selection to treat pending requests/run-status as “expecting fresh work”. - Adds
LockstepRunEventStream.UpdateStatus()and invokes it after checkpoint restore to keepRunStatusaligned with restored pending requests. - Removes channel completion on streaming run loop exit (but this introduces a potential hang risk; see PR comment).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| dotnet/src/Microsoft.Agents.AI.Workflows/Execution/StreamingRunEventStream.cs | Updates epoch “fresh work” detection; changes run-loop shutdown behavior. |
| dotnet/src/Microsoft.Agents.AI.Workflows/Execution/LockstepRunEventStream.cs | Adds a status refresh helper to reflect restored pending requests. |
| dotnet/src/Microsoft.Agents.AI.Workflows/Execution/AsyncRunHandle.cs | Calls the new lockstep status refresh after restoring a checkpoint. |
dotnet/src/Microsoft.Agents.AI.Workflows/Execution/StreamingRunEventStream.cs
Show resolved
Hide resolved
4eb9abd to
812550b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation and Context
A recent set of changes introduced or worsened a timing issue around checkpoint restore with pending requests, causing sporadic test failures due to early "halt" of event streaming.
Description
Add a check for pending events to properly sync up epochs.
Contribution Checklist
[ ] Is this a breaking change? If yes, add "[BREAKING]" prefix to the title of the PR.