Repository navigation
Open
Labels
help wantedEverything needs help from contributors
Description
Pre-check
- I am sure that all the content I provide is in English.
Search before asking
- I had searched in the issues and found no similar issues.
Apache Dubbo Component
Java SDK (apache/dubbo)
Dubbo Version
dubbo-rpc-triple:3.3.6
Netty:4.2.9 use direct memory
jdk:17.0.17
windowns
Steps to reproduce this issue
@DubboReference(
version = "1.0.0",
url = "tri://${dubbo.directUrl}",
protocol = "tri",
check = false,
timeout = 100, // Set a shorter timeout to simulate a rpc timeout
connections = 5,
actives = 5
)
public void setTripleService(TripleExternalService tripleService) {
this.tripleService = tripleService;
}
note : add jvm property -Dio.netty.leakDetectionLevel=PARANOID
If you keep calling a certain method of this interface for a while, it will appear, and the smaller the timeout, the easier it is to reproduce.
output:
io.netty.buffer.AdvancedLeakAwareByteBuf.readByte(AdvancedLeakAwareByteBuf.java:401)
io.netty.handler.codec.http2.DefaultHttp2FrameReader.preProcessFrame(DefaultHttp2FrameReader.java:190)
io.netty.handler.codec.http2.DefaultHttp2FrameReader.readFrame(DefaultHttp2FrameReader.java:146)
io.netty.handler.codec.http2.Http2InboundFrameLogger.readFrame(Http2InboundFrameLogger.java:39)
io.netty.handler.codec.http2.DefaultHttp2ConnectionDecoder.decodeFrame(DefaultHttp2ConnectionDecoder.java:186)
io.netty.handler.codec.http2.DecoratingHttp2ConnectionDecoder.decodeFrame(DecoratingHttp2ConnectionDecoder.java:61)
io.netty.handler.codec.http2.Http2ConnectionHandler$FrameDecoder.decode(Http2ConnectionHandler.java:391)
io.netty.handler.codec.http2.Http2ConnectionHandler.decode(Http2ConnectionHandler.java:451)
io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:545)
io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:484)
io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:296)
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:356)
io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:293)
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:354)
io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1429)
io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:918)
io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:172)
io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.handle(AbstractNioChannel.java:445)
io.netty.channel.nio.NioIoHandler$DefaultNioRegistration.handle(NioIoHandler.java:388)
io.netty.channel.nio.NioIoHandler.processSelectedKey(NioIoHandler.java:596)
io.netty.channel.nio.NioIoHandler.processSelectedKeysOptimized(NioIoHandler.java:571)
io.netty.channel.nio.NioIoHandler.processSelectedKeys(NioIoHandler.java:512)
io.netty.channel.nio.NioIoHandler.run(NioIoHandler.java:484)
io.netty.channel.SingleThreadIoEventLoop.runIo(SingleThreadIoEventLoop.java:225)
io.netty.channel.SingleThreadIoEventLoop.run(SingleThreadIoEventLoop.java:196)
io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:1195)
io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
java.base/java.lang.Thread.run(Thread.java:842)
What you expected to happen
I don't know if I used it wrong or if it's actually a bug
Anything else
No response
Do you have a (mini) reproduction demo?
- Yes, I have a minimal reproduction demo to help resolve this issue more effectively!
Are you willing to submit a pull request to fix on your own?
- Yes I am willing to submit a pull request on my own!
Code of Conduct
- I agree to follow this project's Code of Conduct
Metadata
Metadata
Assignees
Labels
help wantedEverything needs help from contributors
Type
Projects
- StatusShow more project fieldsTodo
Activity
fix: release late response ByteBuf when callback executor is shut down (
LeonxLJX commentedon Sep 1, 2026
I'd like to take this one — I'll follow up with a PR. (claiming via @LeonxLJX)
LeonxLJX commentedon Sep 1, 2026
Hi! I'd like to investigate the Dubbo 3.3.6 trip protocol netty memory leak. Plan: reproduce, profile, fix the leak, add a test. May I be assigned?
fix: release late response ByteBuf when callback executor is shut down (
chaoyoung commentedon Nov 10, 2026
Independently reproduced the same callback-executor ownership gap with released Dubbo 3.3.7, Netty 4.2.19.Final and OpenJDK 25. No custom transport SPI was loaded.
The useful distinguishing sequence is a synchronous unary deadline before response headers:
This corroborates the root cause described by #16418; I am not opening a competing fix PR. A regression that exercises an actual pre-header deadline and late codec-delivered DATA would complement the existing shutdown unit test. The paired-codec fixture still uses a mocked upper client-call listener; this is not a production-load measurement or a full TCP RPC benchmark.
There is also a useful negative control: once local RST has actually been processed and exchanged, subsequent peer DATA writes fail and produce no client DATA callbacks. Directly injecting DATA after cancellation should not be presented as proof that it can arrive over a reset wire stream.
I have not applied #16418 to this fixture, so this comment does not claim that the PR has been verified to cover all submission races or all cancellation behavior.
Investigation and this summary were AI-assisted.
LeonxLJX commentedon Nov 12, 2026
Claiming this. I'll take a look and submit a fix PR soon! 🙏