wenjin272 opened a new pull request, #571: URL: https://github.com/apache/flink-agents/pull/571
<!-- * Thank you very much for contributing to Flink Agents. * Please add the relevant components in the PR title. E.g., [api], [runtime], [java], [python], [hotfix], etc. --> <!-- Please link the PR to the relevant issue(s). Hotfix doesn't need this. --> Linked issue: #448 ### Purpose of change When invoking a Java method via Pemja from a Python async thread, if that Java method creates objects using reflection, a `ClassNotFoundException` may occur because the Python async thread lacks the necessary Java environment context. In Flink agents, this issue occurs when the Python API calls a Java resource that depends on other Java resources in async thread. For example, the python chat model action call `chat` of a java chat model setup, and the setup will get the correspond chat model connection, which will construct the connection object by reflection. To resolve this issue, this patch moves the construction from the python async thread to the python pemja thread. This patch depends on https://github.com/alibaba/pemja/pull/95 in pemja. Therefore, we need to wait for the fix versions for Pemja and Flink 1.20, 2.0, 2.1, and 2.2. ### Tests existed e2e test for cross language resources ### API Yes. Add `open` for `Resource` ### Documentation <!-- Do not remove this section. Check the proper box only. --> - [ ] `doc-needed` <!-- Your PR changes impact docs --> - [ ] `doc-not-needed` <!-- Your PR changes do not impact docs --> - [ ] `doc-included` <!-- Your PR already contains the necessary documentation updates --> -- 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]
