John-W-Lewis commented on issue #1142:
URL: https://github.com/apache/arrow-java/issues/1142#issuecomment-4415565736

   Thank you, @axreldable, for responding!
   
   Yes, I could have provided more details on how it does and doesn't behave. 
But we can understand the problem more easily at a higher, modelling, level.
   The model is that a `Vector` owns multiple buffers which are deallocated 
when the Vector is closed. A `VectorSchemaRoot` owns multiple `Vector`s and 
when it is closed, it closes its `Vector`s, causing their buffers to be 
deallocated.
   If we manipulate those relationships, in contravention of that model, so 
that one `VectorSchemaRoot` ends up "thinking"  that it owns the buffers of 
`Vector`s being used by another `VectorSchemaRoot`, then one can close and 
cause the deallocation of buffers which are stlll being used by the other. It's 
simply not conforming to the intended model.
   
   The TransferPair exists to manage the transfer of values between a pair of 
Vectors. I think that we can understand that the current implementation of 
addVector, probably removeVector, and possibly other methods is simply wrong 
without going into the sordid details of the scenarios in which we can get away 
with it or it can go  wrong for each of, on my count, 45 classes for which 
TransferPair is implemented!
   
   Yes, I have a potential fix, however it's very unlikely that I've found all 
of the places in which this fault exists, and I'm very new to using GitHub. 
Nevertheless, let me see what I can do, provided it's not expected to be the 
finished result!
   


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