Repository navigation
fix(core): preserve buffered queries across run eviction - #1693
Merged
Sushisource merged 3 commits intoOct 22, 2026
Merged
Conversation
Eviction must not discard accepted queries when the replacement run is created. Preserve supersession groups and retain the activation produced by a later task while the first waits for history.
Sushisource
approved these changes
Oct 21, 2026
Sushisource
left a comment
Member
There was a problem hiding this comment.
Thanks for this! Love the simplicity.
| @@ -0,0 +1,80 @@ | |||
| use super::{ | |||
Member
There was a problem hiding this comment.
I think it'd be reasonable to just have this be in the test mod at the bottom of the parent module instead of a new file
Contributor
Author
There was a problem hiding this comment.
Thanks for the review! Moved the tests into the parent module’s test mod as suggested.
Member
There was a problem hiding this comment.
Perfect. Looks like it just needs some merge conflict resolution w/ the changelog.
Contributor
Author
There was a problem hiding this comment.
Resolved. I moved the Rust SDK changelog entry to the new fragment format.
Sushisource
enabled auto-merge (squash)
October 21, 2026 21:45
Upstream now records pending Rust SDK changes as release fragments. Preserve the reviewed fix and Core entry while moving the SDK note into the new format.
auto-merge was automatically disabled
October 22, 2026 00:40
Head branch was pushed to by a user without write access
Sushisource
enabled auto-merge (squash)
October 22, 2026 16:23
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.
Fixes #1621.
When eviction completes with multiple same-Run Query tasks buffered, Core reinstantiates the Run from the first task and discards the rest. Preserve the remaining tasks by transferring them into the replacement Run in buffer insertion order, retaining the existing Workflow Task supersession groups. If the first task needs a history fetch, retain the activation produced by a later task with full history.
Regression coverage queues one, two and three Queries during completion eviction with cache capacities 0, 1 and 10 (within their slot limits), using full or mixed history and optionally starting shutdown before acknowledging eviction. A channel barrier ensures all Queries are buffered before eviction proceeds. The test checks each Query is delivered once, all responses reach the client mock, shutdown completes and workflow-task permits are returned. Separate tests guard Query-group preservation when a buffered Workflow Task is superseded.
This transfers already accepted tasks; it does not change polling limits or add a drain loop. Preserved Queries retain their slots until serviced or otherwise released, so shutdown can wait longer than when they were discarded. The tests cover a finite queue with completed handlers, not a shutdown-latency guarantee for unresponsive handlers.
Validation on macOS arm64 against upstream
0a5d6462:cargo lint,cargo test-lintand formatting pass.cargo integ-test --server-kind external workflow_tests::queries -- --test-threads=2: all six existing SDK Query tests pass (mock-server tests).