fix(core): delay zero-cache eviction until LA resolutions drain - #1482
Merged
Merged
Conversation
jmaeagle99
marked this pull request as ready for review
August 11, 2026 18:14
Sushisource
approved these changes
Aug 11, 2026
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.
What was changed
The zero-sized-cache eviction in
WFStream::process_completionnow also skips runs that still have jobs queued for lang, not just runs still waiting on local activities. This defers the eviction rather than skipping it sinceprocess_completionis called for every completion; the last completion will not have pending jobs nor outstanding LAs, thus the eviction is queued.Why?
With
max_cached_workflows = 0and local activities, a run could be evicted mid-workflow-task, stranding its LA markers and livelocking the workflow.#1442 delivers LA resolutions incrementally, so a resolution arriving while an earlier one is still outstanding with lang is parked as a pending job. That creates a state which didn't exist before that change: no outstanding LAs, but resolutions still undelivered. So the eviction landed mid-task: the accumulated
RecordMarkercommands werediscarded with the run and the WFT was never reported. Task timeout occurs and server redelivers the WFT; the same run is replayed, same local activities, same result, repeated indefinitely.
On debug builds, like in CI, a panic is intentionally raised with the message
There should not be any outgoing commands or messages when preparing a completion response if the activation was only an eviction. This is an SDK bug..Checklist
How was this tested: New explicitly-driven core test and locally with sdk-python submodule update
Any docs updates needed? No