weiqingy commented on issue #724: URL: https://github.com/apache/flink-agents/issues/724#issuecomment-4606372957
@joeyutong Thanks — backport PR is up: #727. On the Python question: yes, I included a minimal Python-side guard in the same PR. The race is real there too on `release-0.2`. The async action thread pool runs actions on multiple threads, and `AgentPlan.get_resource` does the same non-atomic check-create-cache over a plain dict; the GIL doesn't make it atomic because `provider.provide()` can release the GIL when it calls into Java via Pemja. So I wrapped `get_resource` in a per-instance reentrant lock, mirroring the Java `synchronized`. (It's a `cached_property` rather than a Pydantic private attribute so it stays out of model equality.) Both sides ship with the regression test from your repro — a two-thread race on the first access to a shared resource — and each test fails without its guard and passes with it. -- 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]
