[bug][runtime] Derive durable-state action UUID from the plan-unique action name - #1094
Open
purushah wants to merge 1 commit into
Open
[bug][runtime] Derive durable-state action UUID from the plan-unique action name#1094purushah wants to merge 1 commit into
purushah wants to merge 1 commit into
Conversation
…action name Action.hashCode() folds in JavaFunction's Class[] parameterTypes, and Class.hashCode() is the per-JVM identity hash, so every durable-state key changes across a process restart and recovery lookups can never hit. Kill/restore trials: 0/134 replays before this fix; 90/90 with 0% divergence after (non-deterministic strategy, Kafka action-state store).
purushah
force-pushed
the
fix-action-state-key-stability
branch
from
September 3, 2026 23:22
ba6d9e9 to
42ef26c
Compare
This was referenced Sep 4, 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.
Linked issue: N/A (bug found during recovery testing)
Purpose of change
ActionStateUtil.generateUUIDForActionderives the durable-state key fromAction.hashCode().Action's hash folds inJavaFunction'sClass[]parameterTypes, andClass.hashCode()is the per-JVM identity hash — so every durable-state key silently changes when the JVM restarts. After any failure recovery, lookups can never hit: every action re-executes instead of replaying, which breaks the exactly-once contract of the action-state store (and re-bills every LLM call in agent workloads).This PR derives the UUID from
action.getName(), which is unique within a plan and stable across processes.How it was found
Kill/restore recovery experiments with a deliberately non-deterministic agent and the Kafka action-state store: 0/134 re-processed actions replayed from the store before this fix; 90/90 replayed with 0% divergence after. The existing test suite doesn't catch it because all tests run inside a single JVM, where identity hashes are stable.
Compatibility note
The key format changes, so state written by prior versions won't be found on restore. Those keys were already unreadable across restarts (that's the bug), so no working deployment regresses; single-process re-reads within one JVM lifetime are unaffected in practice because recovery is the only reader.
Tests
ActionStateUtilTest: (1) the action-UUID key segment equalsUUID.nameUUIDFromBytes(action.getName())— pins the derivation, so any future key-format change is a conscious, reviewed break of cross-restart state compatibility (verified to FAIL against the pre-fix code); (2) two separately constructedActioninstances with the same name — what "the same action, after a JVM restart" looks like — produce identical state keys.mvn test -pl runtime -am -Dtest='*ActionState*'— 129 tests, 0 failures (includesActionStateUtilTest,KafkaActionStateStoreTest, Fluss store integration tests), on current main (rebased over [Bug] Recovered Durable ActionState for keys owned by other subtasks is never pruned #1024).API
No public API changes.
Documentation
doc-neededdoc-not-neededdoc-includedWas this patch authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Claude Fable 5)