chaoyoung opened a new pull request, #16585:
URL: https://github.com/apache/dubbo/pull/16585
Fixes #16584
### What changes were proposed in this pull request?
Triple server DATA rejected or silently discarded before decoder execution
can retain its reference-counted input even after stream closure. Prepare
HTTP/2 DATA ownership before executor submission, route explicit rejection
through the existing message error cleanup, and retain close-once input
wrappers in a transport registry until delivery begins.
Stream close and remote cancellation drain only inputs still owned by the
transport. A short lifecycle lock defers pending cleanup while an
already-started DATA callback is preparing its message. At the message-listener
handoff, registry ownership ends; accepted decoder buffers retain their
existing lifecycle and are never released by the registry. The original stream
id, end-stream status, and message close behavior are preserved.
`SerializingExecutor` behavior and unrelated task APIs are unchanged.
### Why are the changes needed?
A decode task is not a reliable owner until it actually runs. Saturation can
reject it, while backing-executor shutdown can silently discard it. Decoder
cleanup alone cannot release bodies it never received.
### Does this PR introduce any user-facing change?
No configuration changes. Server DATA bodies are released when submission
fails or the stream terminates before a discarded task can deliver them.
### How was this patch tested?
The initial regression run failed four of five tests on the unchanged base,
each observing reference count 1 where release was expected. The accepted
partial-input control passed.
The completed fixture exercises a real gRPC streaming decoder and server
response-observer close/cancel behavior, with application routing and
invocation isolated. It covers saturated real-pool rejection, shutdown discard
on close/cancel, accepted partial input, queued close-before-execution,
complete-message consumption, late DATA, exact-once original-message closure,
and terminal/handoff races.
A deterministic concurrency regression buffers DATA A, blocks a later DATA B
callback inside A's read, cancels the stream, and verifies that both
decoder-owned buffers remain valid. Another closes after message-listener
handoff but before gRPC decode, exercising existing closed-decoder cleanup.
Accepted partial input remains decoder-owned after remote cancellation and is
released by ordinary stream close.
```sh
mvn -q -pl dubbo-rpc/dubbo-rpc-triple -am \
-Dtest=GenericHttp2ServerTransportListenerTest,GrpcStreamingDecoderTest,AbstractH2TransportListenerTest,LengthFieldStreamingDecoderTest,SerializingExecutorTest
\
-Dsurefire.failIfNoSpecifiedTests=false -Dspotless.action=apply test
mvn -q -pl dubbo-rpc/dubbo-rpc-triple spotless:check
git diff --check
```
Passed: 19 tests, zero failures/errors/skips (12 ownership tests and 7
adjacent decoder, executor, and transport tests). Spotless check and git diff
whitespace check both passed. No snapshot artifacts were installed into the
local Maven repository.
### Related work and scope
#16391 fixes input reaching an already closing or closed
`LengthFieldStreamingDecoder`; this change handles server inputs discarded
before delivery. #16415 and the open #16418 concern client synchronous-unary
timeout / late-response callback executor shutdown. #16418 was not applied to
this fixture or independently verified here.
This patch does not claim to resolve accepted partial-input cancellation or
make all decoder read/close races thread-safe. Accepted input follows the
existing decoder lifecycle. No client cancellation or general executor-discard
redesign is included.
### AI assistance
This change and its tests were developed with AI assistance and validated
against the upstream Maven reactor.
--
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]