Repository navigation
Release streamed history snapshots after test-host work items complete - #811
Merged
wangbill (YunchuWang) merged 1 commit intoOct 6, 2026
Merged
Conversation
Release each worker replay snapshot when its orchestration episode finishes or dispatch fails, while retaining it through history reads and partial responses. Preserve independently stored management history and purge behavior. Add deterministic server lifetime coverage and public-client reused-host and ContinueAsNew regressions. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 6bdf65c9-fecb-407f-ae60-016e81eb28c0
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The localized cleanup preserves active readers and committed history, with focused regression coverage and no identified blocking issues.
Review effort: Balanced
Findings: None
What changed in this PR
Fixes retained worker-replay history snapshots in the in-process test host without changing public SDK behavior.
Changes:
- Releases invocation-owned snapshots after the final response or dispatch failure.
- Adds lifetime regressions and reused-host tests, including
ContinueAsNew. - Documents snapshot lifetime separately from committed history.
| File | Description |
|---|---|
| test/InProcessTestHost.Tests/WorkerHistorySnapshotTests.cs | Tests cleanup, partial responses, active readers, and episode isolation. |
| test/InProcessTestHost.Tests/OrchestrationHistoryTests.cs | Tests host reuse, streaming, committed history, and purge. |
| src/InProcessTestHost/Sidecar/Grpc/TaskHubGrpcServer.cs | Adds owner-scoped snapshot cleanup in finally. |
| src/InProcessTestHost/README.md | Clarifies replay snapshot lifetime. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
kaibocai (kaibocai)
approved these changes
Oct 6, 2026
wangbill (YunchuWang)
deleted the
yunchuwang-release-test-host-history-buffers
branch
October 6, 2026 21:05
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.
Summary
What changed?
Release the in-process test host's streamed worker-replay snapshot when its
ExecuteOrchestratorcall finishes. One owner-scopedfinallyspans dispatch and the awaited final response, and removes only that invocation's snapshot.Keep snapshots available during active episodes, history reads, and partial responses. Add deterministic lifetime regressions and real public-client tests that reuse one host for two large instances, including
ContinueAsNew, and clarify the lifetime in the test-host README.Why is this change needed?
Episodes with more than 1 MiB of encoded past events leave a redundant protobuf history list strongly referenced after completion or dispatch failure. These snapshots accumulate as the test host is reused, even after public purge removes the authoritative instance state. Cleanup belongs to the episode's lifetime, not instance completion or purge.
Issues / work items
Project checklist
release_notes.mdAI-assisted code disclosure (required)
Was an AI tool used? (select one)
If AI was used:
TaskHubGrpcServer.cs, the in-process test-host README,OrchestrationHistoryTests.cs, andWorkerHistorySnapshotTests.cs.AI verification (required if AI was used):
Testing
Automated tests
InProcessTestHost.Tests, Release: 57/57 passed; no failures or skips.InProcessTestHost, Release: net6.0, net8.0, and net10.0 builds passed with 0 errors and 84 nullable, obsolete-API, analyzer, and style warnings in unchanged code.git diff --check origin/main...HEAD: passed.The regressions cover active snapshot availability, partial and final responses, generic send failure, closed/disconnected streams, another active instance, an already-started reader, and the next episode's snapshot. Public-client tests verify actual worker streaming above 1 MiB, no retained snapshots before purge, queryable committed history, and successful purge on a reused host.
Manual validation (only if runtime/behavior changed)
Notes for reviewers