gortiz commented on PR #19021: URL: https://github.com/apache/pinot/pull/19021#issuecomment-6827364325
@yashmayya thanks for checking this, and sorry for the late answer. It was not a deliberate trade, just a side effect of the cleaner. A view now keeps the owning buffer reachable (for a view of a view, the original owner). The cleaner of a leaked owner then runs only after all its views are unreachable, which matches the Unsafe and ByteBuffer implementations. I left `toDirectByteBuffer` as is, as you suggested, because the `PinotDataBuffer` contract already forbids using its result after the buffer is released. I also added the tests you asked for. `testLeakedBufferIsFreedOnCollection` checks that the arena of a leaked buffer is closed after GC. `testViewKeepsLeakedOwnerAlive` checks that native, non-native and nested views keep a leaked owner alive. The second one fails without the fix. Both are in 0a29906. -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
