normanmaurer opened a new pull request #26609: [SPARK-29971] Fix multiple possible buffer leaks in `TransportFrameDe… URL: https://github.com/apache/spark/pull/26609 …coder` and `TransportCipher` Motivation: We need to carefully manage the ownership / lifecycle of `ByteBuf` instances so we don't leak any of these. We did not correctly do this in all cases: - when end up in invalid cipher state. - when partial data was received and the channel is closed before the full frame is decoded Modifications: - Release message before throwing `IOException` in case of cipher is not valid - Correctly close `ByteArrayReadableChannel` even when cipher is not valid and so be sure the previous feed `ByteBuf` is released - Move closing / releasing logic to `handlerRemoved(...)` so we are guarenteed that is always called. - Add tests for `ByteArrayReadableChannel` - Correctly release `frameBuf` it is not null when the handler is removed (and so also when the channel becomes inactive) Result: Fixes https://github.com/netty/netty/issues/9784.
---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
