raulcd opened a new pull request, #50687:
URL: https://github.com/apache/arrow/pull/50687

   ### Rationale for this change
   
   PyFlightServer keeps a reference towards the Python server via 
`OwnedRefNoGIL server_`, the Python server also keeps a reference of the C++ 
`PyFlightServer` creating a cycle that is never freed during the process 
lifetime.
   
   ### What changes are included in this PR?
   
   Create a new `ReleasePythonServerRef` method that is called after any 
`server.Shutdown` (including at __exit__) allowing for the `OwnedRefNoGIL` to 
be cleared breaking the cycle lets normal reference counting free the 
previously leaked Python object.
   
   ### Are these changes tested?
   
   Yes, the newly added tests were failing leaking the references before the 
fix.
   Currently a test demonstrating a leak when not calling server.Shutdown is 
added for discussion purposes.
   
   ### Are there any user-facing changes?
   
   No
   


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