bpattarkine opened a new pull request, #1426: URL: https://github.com/apache/flink-agents/pull/1426
Fixes #1425 ### Purpose of change Flink Agents jobs can run with `pipeline.generic-types=false`. #### Runtime flow During graph construction, the default agent output declares an explicit Kryo serializer. During operator initialization, the runtime does the same for events, action tasks, memory items, processing keys, and recovery markers. State traversal and recovery use the same descriptors as initialization. #### Key decisions Use the existing Kryo serializer with the job's serializer configuration for these runtime-managed types. This preserves the serializer used for existing state. ### Behavioral Semantics #### Interaction decisions | Job setting | Runtime-managed types in this change | Other types | | --- | --- | --- | | Generic types enabled | Explicit Kryo with job serializer configuration | Flink resolves serializers as usual | | Generic types disabled | Explicit Kryo with job serializer configuration | Flink still applies the generic-type restriction | #### Behavioral contracts - A keyed Java agent can process events, update keyed memory, and emit results with generic types disabled. - The affected state descriptors retain their state names and Kryo serializer class. #### Failure behavior Serializer creation for these runtime-managed types proceeds with generic types disabled. Kryo serialization errors still propagate through the existing runtime paths. ### Tests | Contract | Verification | | --- | --- | | Keyed agent processes events, maintains per-key memory and emits results with generic types disabled | `GenericTypesDisabledTest.runsAgentWithGenericTypesDisabled` passed with checkpointing enabled | | Affected state retains its names and Kryo serializer class | Verified by inspecting the descriptors and serializer construction. Restore from a pre-change checkpoint was not exercised. | Focused Maven reactor test passed. The full suite was not run. <details> <summary>Serializer and state descriptor details</summary> `InternalKryoTypeInfo` creates `KryoSerializer` with the declared type class and supplied `SerializerConfig`. The pending-event and action-task traversal descriptors use the same type information as the corresponding initialization descriptors. Durable recovery marker reads and writes use the same union list state descriptor. </details> ### API The change is internal to the Java runtime. State serializer compatibility is expected from retaining the state names, type classes, and Kryo serializer configuration. ### Documentation - [ ] `doc-needed` - [x] `doc-not-needed` - [ ] `doc-included` ### Was this patch authored or co-authored using generative AI tooling? - [x] Yes - [ ] No Generated-by: Claude Code 2.1.259 (Claude Sonnet 5.5) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
