Repository navigation
[runtime] Cover the cross-loader action key failure and document action renaming - #1094
Conversation
ba6d9e9 to
42ef26c
Compare
730720a to
c34d2c0
Compare
rob-9
left a comment
There was a problem hiding this comment.
thanks! these address my earlier comments.
everything looks good. I've added two non-blocking suggestions below about documenting future action changes and qualifying the separate-JVM test claim.
|
Thanks for working on this, and apologies—I mistakenly merged #1100 before reviewing and merging this PR, even though it was based on your changes. I preserved your The core action-name-based identifier change is already on |
…on renaming The name-based action segment landed on main through apache#1100. Carry over the remaining pieces: Add ActionStateUtilCrossClassLoaderTest, which loads an Event subclass through two isolating class loaders so the parameter Class objects get different identity hashes, the same effect a JVM restart has on JavaFunction.hashCode(). It fails with the hash-based derivation restored and passes on main. Remove testSameActionNameYieldsSameKeyAcrossInstances: both instances share the same Class objects inside one JVM, so it passed before the fix too. Date the incompatible key-format change to Flink Agents 0.4 in the upgrade hint and state that an action's recorded results survive a code change only while its name is unchanged. Generated-by: Claude Code (Claude Fable 5.1) Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
c34d2c0 to
9875cc2
Compare
|
Rebased onto |
wenjin272
left a comment
There was a problem hiding this comment.
Thanks for the rebasing. LGTM
Linked issue: N/A (follow-up to the action-key fix that landed through #1100)
Purpose of change
Durable action-state keys used to derive the action segment from
Action.hashCode(). For Java actions that hash folds inJavaFunction'sClass<?>[] parameterTypes, andClass.hashCode()is a per-JVM identity hash, so every key changed on restart and recovery never replayed completed actions. The fix, deriving the segment from the plan-uniqueaction.getName(), is already onmainthrough #1100, which was stacked on this branch.This PR carries what remains: a regression test that reproduces the restart failure, removal of a test that could not detect it, and two clarifications to the upgrade guidance #1100 added.
Behavioral Semantics
Behavioral contracts
Actions with the same name whoseJavaFunctionparameter types are distinctClassobjects, loaded by different class loaders, produce the same state key.Failure behavior
Nothing in this change raises or changes a runtime path. The test skips, rather than fails, in the rare case that the two
Classobjects happen to receive equal identity hashes, because there is then nothing to discriminate.Tests
ActionStateUtilCrossClassLoaderTest, newActionStateUtilTest.testActionUUIDSegmentDerivesFromActionName, already onmainActionStateUtilCrossClassLoaderTestloads anEventsubclass through two isolating class loaders, which yields two distinctClassobjects with different identity hashes, the same effect a JVM restart has onJavaFunction.hashCode(). The loader redefines only the subclass and delegates everything else to the parent, soAction's signature check againstEventstill passes. Verified againstmainwith the action segment temporarily switched back toAction.hashCode(): the test fails on the action-UUID segment; withmainas is, it passes.ActionStateUtilTest.testSameActionNameYieldsSameKeyAcrossInstancesis removed. Both instances share the sameClassobjects inside one JVM, so it passed before the fix too.The earlier cross-JVM test that launched two
javaprocesses is not carried over. As noted in review, separate JVMs do not guarantee different identity hashes and the test passes on JDK 17 with the old derivation restored, so it added CI time without discriminating the bug.JAVA_HOME=<jdk17> mvn test -pl runtime -am -Dtest='ActionStateUtil*': 29 tests, 0 failures.mvn spotless:checkunder JDK 17 passes.API
No public API or runtime change.
Documentation
doc-neededdoc-not-neededdoc-includedTwo edits to the upgrade hint under Exactly-Once Action Consistency in
deployment.md: the incompatible key-format change is dated to Flink Agents 0.4, and a sentence states that an action's recorded results survive a code change only while its name is unchanged.Was this patch authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Claude Fable 5.1)
🤖 Generated with Claude Code