BryanCutler commented on a change in pull request #7753:
URL: https://github.com/apache/arrow/pull/7753#discussion_r496922290
##########
File path: python/pyarrow/jvm.py
##########
@@ -28,24 +28,45 @@
import pyarrow as pa
-def jvm_buffer(arrowbuf):
+class _JvmBufferNanny:
+ """
+ An object that keeps a org.apache.arrow.memory.ArrowBuf's underlying
+ memory alive.
+ """
+ ref_manager = None
Review comment:
So if you have multiple threads creating `jvm_buffer`s with different
backing reference manager instances, isn't it possible that one thread will
overwrite the class attribute `ref_manager` being used in another thread, then
both will call `ref_manager.retain()` using the same `ref_manager` class
attribute?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]