Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Python][C++] Simplify/Validate PyObject refcount in udf.cc #36000

Open
icexelloss opened this issue Jun 8, 2023 · 0 comments
Open

[Python][C++] Simplify/Validate PyObject refcount in udf.cc #36000

icexelloss opened this issue Jun 8, 2023 · 0 comments

Comments

@icexelloss
Copy link
Contributor

Describe the bug, including details regarding any error messages, version, and platform.

In udf.cc, there is interaction between C++ and Python where the C++ code holds a user defined Python object inside a Kernel and invoke it over input data.

Due to this interaction, there are a number of Py_INCREF call as well as using OwnRef to manage the refcount for the PyObject (which represents the user defined function. The current code for managing it is either over complicated and/or bug where the C++ code might be over increasing the refcount. While this is not a huge issue (it probably cause the Python function to never be garbage collected), it could use some clean up / documentation as least to improve maintainability.

Appendix:

Component(s)

C++

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants