Github user zsxwing commented on the pull request: https://github.com/apache/spark/pull/11193#issuecomment-184096704 After going through other codes, I think the previous codes are correct. However, the doc of `convertToNetty` is not clear about the ownership of the reference. It transfers the ownership of the internal reference in ManagedBuffer to the caller. In other words, after calling `convertToNetty`, we don't need to call `ManagedBuffer.release`. However, I understand that #10705 requires `ManagedBuffer.release` should be called when its life ends. So how about changing the semantics of `convertToNetty` to this: `convertToNetty` shares the internal content to the caller; `ManagedBuffer.release` should be called when its life ends, and the caller of `convertToNetty` should release the returned object. What do you think?
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org