paleolimbot commented on issue #2629:
URL: https://github.com/apache/arrow-adbc/issues/2629#issuecomment-2737058101

   I was worried this was about the fact that nanoarrow does not check 
alignment since that's come up with Flight + Rust before. I can prematurely add 
an "ensure aligned" anyway since we really should have that.
   
   > Structure the ADBC driver to keep resources alive more strongly
   
   It's on the client side, but https://github.com/apache/arrow-adbc/pull/2274 
has a mechanism for checking the full heiarchy of 
reader/statement/connection/database/driver so that this "can't" happen. I tend 
to think it's the client's responsibility to maintain this validity (which is 
"guaranteed" by the C spec, so even if our own drivers provide some extra 
safety there's no guarantee an arbitrary driver will do the same).
   
   The last time I thought about doing this from the driver side I thought that 
maybe the reader (e.g.) should have a 
`std::shared_ptr<ParentToken<AdbcStatement>>` and the statement should have a 
`std::vector<std::shared_ptr<ParentToken<AdbcStatement>>`. Then on finalize it 
could set all the child token references to NULL (giving the readers a 
mechanism to check for a valid parent before doing something that might crash). 
Perhaps this is what a `weak_ref` is doing as well 🙂 


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