QuakeWang opened a new pull request, #10:
URL: https://github.com/apache/paimon-mosaic/pull/10

    ## Problem
   
   The Java/JNI writer used inconsistent Arrow C Data ownership semantics.
   
   In the writer open path, Java exported an `ArrowSchema` and released it only 
after native open returned successfully, while JNI only borrowed the schema. If 
native open failed, the exported C Data resources could be left unreleased.
   
   The write path had the same issue for exported `ArrowArray` and 
`ArrowSchema`: JNI moved the structs but only cleared the Java-side structs 
after a successful import, so import failures could leave exported resources 
owned by Java without being released. This differed from the C FFI path, which 
clears the source structs immediately after taking ownership.
   
   Closed writer paths in Java/Python also exported Arrow C Data before native 
rejected the write.
   
   ## Fix
   
     - Make JNI writer open/write paths consume Arrow C Data structs with 
`from_raw`, clearing the caller structs immediately.
     - Release Java Arrow C exports in `finally` only when the struct still has 
an active release callback.
     - Check Java/Python closed writer state before exporting Arrow C Data.
     - Add Java/Python regression coverage for write-after-close.


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