chaoyoung opened a new issue, #16584:
URL: https://github.com/apache/dubbo/issues/16584

   ### Pre-check
   
   - [x] I am sure that all the content I provide is in English.
   
   
   ### Search before asking
   
   - [x] I had searched in the 
[issues](https://github.com/apache/dubbo/issues?q=is%3Aissue) and found no 
similar issues.
   
   
   ### Apache Dubbo Component
   
   Java SDK (apache/dubbo)
   
   ### Dubbo Version
   
   3.3.8-SNAPSHOT, 3.3 branch at 1cf125c421691ab2b3f1b82f0125be03eff338c9; 
OpenJDK 25, macOS
   
   ### Steps to reproduce this issue
   
   ### Description
   
   Triple HTTP/2 server DATA bodies can remain unreleased when their decode 
task does not run. An initialized server listener submits DATA processing to 
`SerializingExecutor`, but ownership only reaches the message 
listener/streaming decoder inside that task.
   
   Two executor cases leave the body outside decoder ownership:
   
   1. A saturated backing `ThreadPoolExecutor` rejects scheduling. 
`AbstractServerTransportListener.onData` currently has no rejection cleanup.
   2. A shut-down backing executor makes `SerializingExecutor` remove the 
submitted task without running it or throwing. Closing the server listener only 
closes bodies that already reached the decoder, leaving this DATA body 
unreleased.
   
   The normal initialized gRPC decoder-close path does release its buffered 
input; the missing ownership is before decoder delivery.
   
   ### Reproduction
   
   A standalone unit fixture initializes the listener through its metadata 
callback, with routing and application invocation isolated. It uses a real 
`SerializingExecutor`, a real bounded `ThreadPoolExecutor`, the real gRPC 
streaming decoder and server response-observer close/cancel behavior, and 
reference-counted Netty input bodies. No remote service is required.
   
   - Saturate a one-thread, one-slot pool after metadata initialization, then 
submit DATA: the body retains reference count 1 after rejection and listener 
close.
   - Shut the pool down after initialization, submit DATA, then close or 
remotely cancel the listener: the discarded body's reference count remains 1.
   - As controls, accepted partial DATA remains live until stream close, and 
fully consumed DATA is released by the decoder.
   
   ### Expected behavior
   
   Release rejected DATA immediately. Retain transport ownership of DATA that 
has not been handed to the message listener so that stream close or 
cancellation can release silently discarded inputs. Transfer ownership to the 
decoder when delivery starts, preserving its existing buffered-input lifecycle. 
Close each original message once.
   
   ### Version
   
   Reproduced on the `3.3` branch at `1cf125c421691ab2b3f1b82f0125be03eff338c9` 
(3.3.8-SNAPSHOT sources), using JDK 25 and the repository Maven reactor.
   
   ### Related work and scope
   
   - #16391 fixes input reaching an already closing or closed 
`LengthFieldStreamingDecoder`; it does not cover server tasks discarded before 
decoder delivery.
   - #16415 reports a client synchronous-unary timeout / `ThreadlessExecutor` 
shutdown late-DATA gap.
   - The open #16418 proposes client late-response callback executor shutdown 
handling for #16415. That patch was not applied to this fixture or 
independently verified here.
   
   This report concerns server pre-decoder executor ownership. It does not 
claim to resolve client cancellation or accepted partial-input cancellation; 
accepted inputs retain the existing decoder lifecycle.
   
   ### AI assistance
   
   This report and the proposed regression tests/fix were prepared with AI 
assistance. The reproduction and validation use the upstream source and 
standalone tests.
   
   
   ### What you expected to happen
   
   Rejected DATA should be released immediately; DATA discarded before 
message-listener delivery should remain transport-owned and be released on 
stream termination. Instead, reference count stays 1 after rejection/discard 
and listener close. Accepted decoder input should retain its existing ownership.
   
   ### Anything else
   
   Regression tests and proposed fix: 
https://github.com/chaoyoung/dubbo/tree/codex/triple-server-input-ownership . 
Initial base run: four of five tests fail with unreleased input, 
accepted-partial control passes. Final fix: 19 targeted tests pass (12 
ownership + 7 adjacent), zero failures/errors/skips; Spotless and whitespace 
checks pass. The fixture isolates application routing and uses an H2 channel 
test double; this is not a full network/load test. AI-assisted contribution.
   
   ### Do you have a (mini) reproduction demo?
   
   - [x] 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?
   
   - [x] Yes I am willing to submit a pull request on my own!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to