joeyutong opened a new pull request, #944:
URL: https://github.com/apache/flink-agents/pull/944

   Linked issue: #942
   
   ### Purpose of change
   
   `PythonActionExecutor` owns the Pemja `PyObject` handles for its Python 
async thread pool and runner context. The existing close path invokes 
Python-level cleanup but does not call `PyObject.close()`, which performs 
Pemja's native `decRef`. Repeated task restarts can therefore retain old runner 
contexts and their Flink task graphs through JNI global references.
   
   This change:
   
   - runs Python-level cleanup before releasing each owned `PyObject`;
   - releases both handles even if one cleanup operation fails;
   - preserves the first failure and attaches later failures as suppressed 
exceptions; and
   - clears the fields so repeated close calls are idempotent.
   
   ### Tests
   
   - `mvn -B --no-transfer-progress -pl runtime -am 
-Dtest=PythonActionExecutorTest -Dsurefire.failIfNoSpecifiedTests=false test` 
(2 passed)
   - Maven Spotless formatting/checks passed as part of the Java verification
   - Local 20-restart failover A/B: post-Full-GC heap growth changed from 29.2 
MiB to 1.7 MiB, and old runner-context/task graphs were no longer retained 
after termination
   
   ### API
   
   No public API changes.
   
   ### Documentation
   
   - [ ] `doc-needed`
   - [x] `doc-not-needed`
   - [ ] `doc-included`
   


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