bowenli-oai opened a new pull request, #27848: URL: https://github.com/apache/flink/pull/27848
## Summary - fix the embedded Python operators to avoid directly casting returned PEMJA iterators to the local `PyIterator` class - add a reflective `EmbeddedPythonIterator` adapter and use try-with-resources when consuming results from embedded user functions and timers - add tests that reproduce the cross-classloader cast failure after recovery and verify the new adapter works with foreign classloaders ## Why [FLINK-39226](https://issues.apache.org/jira/browse/FLINK-39226) reports that after recovery the embedded Python path can receive a `pemja.core.object.PyIterator` loaded by a different user-code classloader, which makes direct casts fail with `ClassCastException`. ## Testing - `./mvnw -pl flink-python -am -Dfast -DskipITs -Dtest=EmbeddedPythonIteratorTest -Dsurefire.failIfNoSpecifiedTests=false test` -- 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]
