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

[#4017] Implement proper resource leak detection for CompositeByteBuf #4713

Closed
wants to merge 1 commit into from

Conversation

normanmaurer
Copy link
Member

Motivation:

CompositeByteBuf only implemented simple resource leak detection and how it was implemented was completly different to the way it was for ByteBuf. The other problem was that slice(), duplicate() and others would not return a resource leak enabled buffer.

Modifications:

  • Proper implementation for all level of resource leak detection for CompositeByteBuf

Result:

Proper resource leak detection for CompositeByteBuf.

Motivation:

CompositeByteBuf only implemented simple resource leak detection and how it was implemented was completly different to the way it was for ByteBuf. The other problem was that slice(), duplicate() and others would not return a resource leak enabled buffer.

Modifications:

- Proper implementation for all level of resource leak detection for CompositeByteBuf

Result:

Proper resource leak detection for CompositeByteBuf.
@normanmaurer
Copy link
Member Author

@Scottmitch @trustin @nmittler PTAL

@@ -50,6 +50,28 @@ protected static ByteBuf toLeakAwareBuffer(ByteBuf buf) {
return buf;
}

protected static CompositeByteBuf toLeakAwareBuffer(CompositeByteBuf buf) {
ResourceLeak leak;
switch (ResourceLeakDetector.getLevel()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can the level change? If not, would it be make sense to save off some sort of allocator for the leak aware buffers?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it can change

@nmittler
Copy link
Member

@normanmaurer +1 this was badly needed! :)

Took a first pass ... just a few minor comments. Looks great!

@trustin
Copy link
Member

trustin commented Jan 18, 2016

LGTM. Great job!

@normanmaurer
Copy link
Member Author

Cherry-picked into 4.0 (18765a3) and 4.1 (cdb70d3)

@normanmaurer normanmaurer deleted the composite_leak branch January 18, 2016 09:51
@Scottmitch
Copy link
Member

@normanmaurer - lgtm ... great work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants