virajjasani commented on code in PR #4592:
URL: https://github.com/apache/hbase/pull/4592#discussion_r912425974
##########
hbase-common/src/main/java/org/apache/hadoop/hbase/nio/RefCnt.java:
##########
@@ -31,7 +34,10 @@
@InterfaceAudience.Private
public class RefCnt extends AbstractReferenceCounted {
- private Recycler recycler = ByteBuffAllocator.NONE;
+ private static final ResourceLeakDetector<RefCnt> detector =
Review Comment:
> Not sure how much flexibility you have for something like that, maybe in
the SASL layer.
Yeah that's becoming more problematic only because of SASL layer. I upped
target records to 100 and all the leak detected were only coming from Netty's
EpollEventLoop. I even tried switching to `NioEventLoopGroup` but no luck, the
leaks started coming from `NioEventLoop`.
Anyways, I am also going through Netty's code, not 100% confirmed but it
seems these leak messages would appear all the time when `newDirectBuffer()` is
called so it's pretty weird and I am not sure whether this leak is even leak or
just a message that would appear regardless of the leak.
It's like this:
```
@Override
protected ByteBuf newDirectBuffer(int initialCapacity, int maxCapacity) {
PoolThreadCache cache = threadCache.get();
PoolArena<ByteBuffer> directArena = cache.directArena;
final ByteBuf buf;
if (directArena != null) {
buf = directArena.allocate(cache, initialCapacity, maxCapacity);
} else {
buf = PlatformDependent.hasUnsafe() ?
UnsafeByteBufUtil.newUnsafeDirectByteBuf(this,
initialCapacity, maxCapacity) :
new UnpooledDirectByteBuf(this, initialCapacity,
maxCapacity);
}
return toLeakAwareBuffer(buf);
}
```
And `toLeakAwareBuffer()` would report the leak for all the calls made to
create new direct buffer 🤷
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]