You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@paimon.apache.org by "QuakeWang (via GitHub)" <gi...@apache.org> on 2026/06/05 04:20:22 UTC

[PR] [mosaic] Clean up writer resources on construction failure [paimon]

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

   ### Purpose
   
   `MosaicRecordsWriter` creates one `RootAllocator` and shares it between `ArrowFormatWriter` and the native `MosaicWriter`. However, `ArrowFormatWriter` always treated the allocator as owned by itself, making the Mosaic path depend on implicit double-close behavior.
   
   The more concrete issue is constructor failure cleanup: if native `MosaicWriter` construction fails after `ArrowFormatWriter` has been created, callers never receive a writer instance and cannot close the Arrow vectors or allocator.
   
   This PR makes allocator ownership explicit by adding a borrowed-allocator path for `ArrowFormatWriter`. `MosaicRecordsWriter` now owns the allocator it creates and cleans up partially-created native and Arrow resources when construction fails.
   
   ### Tests
   
     - `mvn -pl paimon-arrow -Dtest=ArrowFormatWriterTest#testWriterClosesExternalAllocatorByDefault+testWriterWithBorrowedAllocatorDoesNotCloseAllocator test`
     - `mvn -pl paimon-mosaic -am -DfailIfNoTests=false -Dtest=MosaicRecordsWriterTest test`


-- 
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: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [mosaic] Clean up writer resources on construction failure [paimon]

Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi commented on PR #8129:
URL: https://github.com/apache/paimon/pull/8129#issuecomment-4637978923

   I reviewed this PR as part of a pass over recent open non-draft Paimon PRs. I did not find any clear correctness, compatibility, or regression issue to flag from the current diff.


-- 
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: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [mosaic] Clean up writer resources on construction failure [paimon]

Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi merged PR #8129:
URL: https://github.com/apache/paimon/pull/8129


-- 
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: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org