chaoyoung opened a new pull request, #16586:
URL: https://github.com/apache/dubbo/pull/16586
## What is the purpose of the change?
Fixes #9342 (the current framework fallback's status-message corruption).
CompositeExceptionHandler writes a raw exception message into grpc-message.
A Chinese message such as "业务校验失败" becomes "??????" after HPACK; literal
percent text can also trigger an exception in the client's percent decoder.
gRPC requires UTF-8 followed by percent-encoding for this header.
Apply the existing TriRpcStatus.encodeMessage helper to the framework
fallback after selecting the ordinary or verbose description. Successful custom
ExceptionHandler implementations retain ownership of their trailers and are not
encoded again. No new application configuration or dependency is introduced.
The historical #9375 targeted 3.0; this patch fixes the current 3.3
CompositeExceptionHandler path.
## Validation
Base: 3.3 at 1cf125c421691ab2b3f1b82f0125be03eff338c9. OpenJDK 25 on macOS.
Before changing production code, 9 new regression invocations produced 7
assertion failures, 1 decoding error and 1 passing ASCII control. After the
change, 11 new invocations pass, covering Chinese, emoji, percent/plus,
percent-looking literal text, newline, verbose output, null messages, and
unchanged extension-owned encoded trailers. Tests pass actual generated
trailers through Netty's HPACK encoder/decoder before decoding the received
message.
33 targeted tests pass (11 CompositeExceptionHandlerTest, 21
TriRpcStatusTest, 1 StatusRpcExceptionTest), with no failures, errors or skips:
```sh
mvn -q -pl dubbo-rpc/dubbo-rpc-triple -am \
-Dtest=CompositeExceptionHandlerTest,TriRpcStatusTest,StatusRpcExceptionTest \
-Dsurefire.failIfNoSpecifiedTests=false -Dspotless.action=apply test
mvn -q -pl dubbo-rpc/dubbo-rpc-triple spotless:check
git diff --check
```
Spotless and whitespace checks pass. Separate component probes reproduce the
original corruption with official 3.3.6 and 3.3.7 artifacts and Netty
4.2.19.Final. A separate patched-sender probe after HPACK verifies six cases
with grpc-java 1.77.0's status-message marshaller.
Scope: component-level trailer encoding and marshalling, not a socket RPC or
deployed application test. The full repository suite and CI have not completed.
Malformed inbound percent-decoding tolerance is outside this sender-side fix.
Applications should still use structured error codes for business decisions.
AI assistance was used for the investigation, patch, tests and description.
## Checklist
- [x] Link the existing issue and explain the behavior.
- [x] Add regression tests and observe the original failure.
- [x] Run targeted tests and formatting checks.
- [ ] GitHub Actions pass (pending CI).
--
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]