You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/09/02 22:49:59 UTC

[GitHub] [pulsar] zbentley commented on pull request #16535: [fix] [python client] Better Python garbage collection management for C++-owned objects

zbentley commented on PR #16535:
URL: https://github.com/apache/pulsar/pull/16535#issuecomment-1235955753

   @BewareMyPower I redid some of this work and pulled more logging related logic into pure Python, which is now passed as a callback function into the C++ code. That ends up having fewer issues, as many of the `boost::python` utility functions (like `import`) themselves run the various `PyErr` functions internally, which mutates the error state that is being relied upon by `asyncio` for that failing test.
   
   The code should be a little simpler now, though the line count went up (sorry). 
   
   Additionally, the `PyError_Restore` pattern added for the new logging code should probably be used for other "C++ calls python and shouldn't mess up pre-existing interpreter error state" hooks in `pulsar-client` (e.g. consumer message listeners and the like).


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org