bpattarkine opened a new issue, #1425:
URL: https://github.com/apache/flink-agents/issues/1425

   ### Search before asking
   
   - [x] I searched in the 
[issues](https://github.com/apache/flink-agents/issues) and found nothing 
similar.
   
   ### Description
   
   
   ## Summary
   A job that disables generic types (`pipeline.generic-types: false`, a common 
production setting to avoid silent
   Kryo fallback) cannot use a Flink Agents agent. The operator declares and 
keeps state with types Flink treats as generic.
   
   ## Reproduce
   1. `Configuration conf = new Configuration(); 
conf.set(PipelineOptions.GENERIC_TYPES, false);`
   2. `env = StreamExecutionEnvironment.getExecutionEnvironment(conf)`
   3. `agentsEnv.fromDataStream(stream, keySelector).apply(new 
MyAgent()).toDataStream()`
   
   ## Failures, in order
   1. Graph build: `Generic types have been disabled ... type java.lang.Object` 
— `CompileUtils.connectToAgent` declares the
      operator output as `TypeInformation.of(Object.class)`. (Workaround: 
attach `ActionExecutionOperatorFactory` ourselves
      with a typed output.)
   2. Operator open: `... type org.apache.flink.agents.api.Event` — 
`ActionExecutionOperator.open()` and the pending-input
      `ListStateDescriptor` use `TypeInformation.of(Event.class)`.
   3. State init: `... MemoryObjectImpl$MemoryItem` (sensory / short-term 
memory `MapStateDescriptor`) and `ActionTask`
      (`ListStateDescriptor`).
   4. `currentProcessingKeys` and the union state use 
`TypeInformation.of(Object.class)`. `java.lang.Object` cannot be exempted
      through a `TypeInfoFactory` (Flink resolves it before consulting 
factories), so this one cannot be worked around
      from user code.
   
   ## Ask
   Give these state descriptors explicit serializers (or a key type derived 
from the keyed stream) so the operator works
   with generic types disabled, or document that generic types are required.
   
   
   ### How to reproduce
   
   Configuration conf = new Configuration(); 
conf.set(PipelineOptions.GENERIC_TYPES, false);
   env = StreamExecutionEnvironment.getExecutionEnvironment(conf)
   agentsEnv.fromDataStream(stream, keySelector).apply(new 
MyAgent()).toDataStream()
   
   ### Version and environment
   
   **Project:** apache/flink-agents · **Version:** 0.4.0 
(`flink-agents-dist-flink-2.3`) · **Flink:** 2.3.0 · **Java API**
   
   ### Are you willing to submit a PR?
   
   - [x] I'm willing to submit a PR!


-- 
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]

Reply via email to