Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-29971][CORE] Fix buffer leaks in TransportFrameDecoder/TransportCipher #26609

Closed
wants to merge 1 commit into from

Commits on Nov 22, 2019

  1. [SPARK-29971] Fix multiple possible buffer leaks in `TransportFrameDe…

    …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 in finally block to ensure it is also released in case of cipher is not valid
    - Move closing / releasing logic to `handlerRemoved(...)` so we are guarenteed that is always called.
    - Add tests for `TransportCipher`
    - Correctly release `frameBuf` it is not null when the handler is removed (and so also when the channel becomes inactive)
    
    Result:
    
    Fixes netty/netty#9784.
    normanmaurer committed Nov 22, 2019
    Copy the full SHA
    fb79d0a View commit details
    Browse the repository at this point in the history