flink-agents icon indicating copy to clipboard operation
flink-agents copied to clipboard

[Tech Debt] Avoid create AgentPlan instance each time execute action.

Open wenjin272 opened this issue 1 month ago • 0 comments

Search before asking

  • [x] I searched in the issues and found nothing similar.

Description

Currently, each time execute an action task, ActionExecutionOperator will create a new runner context.

https://github.com/apache/flink-agents/blob/393b9ec946b9008aaf7c99dc0c036a51c80832b4/runtime/src/main/java/org/apache/flink/agents/runtime/operator/ActionExecutionOperator.java#L389

This behavior is to resolve the questions about action async execution, but will create new Resource instance each time execute an action and may cause connection leak risk.

The resources will cached in AgentPlan, so we could move the AgentPlan creation to open of operator, and wrap the same instance each time create new runner context.

Are you willing to submit a PR?

  • [ ] I'm willing to submit a PR!

wenjin272 avatar Nov 28 '25 09:11 wenjin272