Skip to content

ProtocolNegotiators leaks ByteBufs on failure #1401

@ejona86

Description

@ejona86

As reported by @trask in #1277 with repro repo at https://github.com/trask/grpc-netty-leak-repro. The key distinguishing feature is BufferUntilChannelActiveHandler in the log here:

SEVERE: LEAK: ByteBuf.release() was not called before it's garbage-collected. See http://netty.io/wiki/reference-counted-objects.html for more information.
Recent access records: 2
#2:
        Hint: 'ProtocolNegotiators$BufferUntilChannelActiveHandler#0' will handle the message from this point.

When looking at the code, it is obvious it doesn't release when it fails the promise. This leak only happens when failing to establish a connection to the server.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions