You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "CCCLL (via GitHub)" <gi...@apache.org> on 2026/10/19 11:55:30 UTC
[PR] Read triple max-message-size from the global configuration [dubbo]
CCCLL opened a new pull request, #16518:
URL: https://github.com/apache/dubbo/pull/16518
## What is the purpose of the change?
Fixes #16517.
`dubbo.protocol.triple.max-message-size` (added in #15781) is read by `LengthFieldStreamingDecoder`, `Gzip` and `Bzip2` through `ConfigurationUtils.getEnvConfiguration(...)`, which only looks at OS environment variables. Setting the limit as a system property, in `dubbo.properties` or in Spring Boot properties has no effect, so it can neither be lowered nor raised above the 50 MB default that way.
This PR reads the key through `ConfigurationUtils.getGlobalConfiguration(...)`, as the other `dubbo.protocol.triple.*` keys that are read without a URL already do (`rest.json-framework` in `HttpJsonUtils`, `rest.disallowed-content-types` in `CodecUtils`, `verbose`, `rest.enabled` and `rest.openapi.enabled` in `TripleProtocol`). The global configuration covers system properties, environment variables, the config center, Spring Boot properties (copied in by `DubboContextPostProcessor`) and `dubbo.properties`.
## Behavior change
- Applications that already set `dubbo.protocol.triple.max-message-size` as a system property, in `dubbo.properties` or in Spring Boot properties, where it had no effect so far, now get that limit instead of the 50 MB default. A lower limit starts rejecting larger Triple messages with `Message size N exceeds limit M` (gzip and bzip2 messages that decompress beyond it fail as well); a higher limit lets messages above 50 MB pass the size check. Applications that do not set the key are not affected.
- Environment variables keep working. If the key is set both as a system property and as an environment variable, the system property now wins, following the precedence of the global configuration.
## Not covered
A limit set only programmatically through `TripleConfig#setMaxMessageSize` is still not read: the decoder and the decompressors are created without access to the protocol config (the client stream has no URL). The other keys listed above behave the same way.
## Verification
- New tests, all of which fail before the change and pass after it:
- `LengthFieldStreamingDecoderTest#honorsMaxMessageSizeFromSystemProperty`
- `LengthFieldStreamingDecoderTest#honorsMaxMessageSizeFromApplicationProperties` (sets the key in the application configuration, where Spring Boot properties are copied to)
- `GzipTest#decompressionHonorsConfiguredMaxMessageSize` and `Bzip2Test#decompressionHonorsConfiguredMaxMessageSize` (system property)
- `mvn install -pl dubbo-remoting/dubbo-remoting-http12,dubbo-rpc/dubbo-rpc-triple`: 25 and 486 tests, 0 failures (2 skipped in each module by `@EnabledOnOs(OS.LINUX)` / `@Disabled`); spotless and checkstyle are clean.
- End to end, a Triple provider and consumer in one JVM, limit 1024, request carrying a 4096-character string:
| How the limit is set | before | after |
|---|---|---|
| environment variable | rejected | rejected |
| `-D` system property | accepted | rejected |
| `dubbo.properties` | accepted | rejected |
| Spring Boot `application.properties` | accepted | rejected |
| not set | accepted | accepted |
Rejected calls fail with `Message size 4130 exceeds limit 1024`.
## Checklist
- [x] Make sure there is a [GitHub_issue](https://github.com/apache/dubbo/issues) field for the change.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit-test to verify your logic correction. If the new feature or significant change is committed, please remember to add sample in [dubbo samples](https://github.com/apache/dubbo-samples) project.
- [ ] Make sure gitHub actions can pass. [Why the workflow is failing and how to fix it?](../CONTRIBUTING.md)
--
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: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] Read triple max-message-size from the global configuration [dubbo]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #16518:
URL: https://github.com/apache/dubbo/pull/16518#issuecomment-6267130251
## [Codecov](https://app.codecov.io/gh/apache/dubbo/pull/16518?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 58.68%. Comparing base ([`ae809de`](https://app.codecov.io/gh/apache/dubbo/commit/ae809de2fc81b408194240965eb20bf27e6971df?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`9b46f0c`](https://app.codecov.io/gh/apache/dubbo/commit/9b46f0c1bb3e17c22c5ad4d01e734c853e00125c?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
:warning: Report is 1 commits behind head on 3.3.
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## 3.3 #16518 +/- ##
============================================
- Coverage 60.92% 58.68% -2.25%
Complexity 15 15
============================================
Files 1953 1953
Lines 89278 89259 -19
Branches 13476 13391 -85
============================================
- Hits 54390 52378 -2012
- Misses 29313 31134 +1821
- Partials 5575 5747 +172
```
| [Flag](https://app.codecov.io/gh/apache/dubbo/pull/16518/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [integration-tests-java21](https://app.codecov.io/gh/apache/dubbo/pull/16518/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [integration-tests-java8](https://app.codecov.io/gh/apache/dubbo/pull/16518/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [samples-tests-java21](https://app.codecov.io/gh/apache/dubbo/pull/16518/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [samples-tests-java8](https://app.codecov.io/gh/apache/dubbo/pull/16518/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [unit-tests-java11](https://app.codecov.io/gh/apache/dubbo/pull/16518/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [unit-tests-java17](https://app.codecov.io/gh/apache/dubbo/pull/16518/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [unit-tests-java21](https://app.codecov.io/gh/apache/dubbo/pull/16518/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `58.68% <100.00%> (+0.01%)` | :arrow_up: |
| [unit-tests-java25](https://app.codecov.io/gh/apache/dubbo/pull/16518/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [unit-tests-java8](https://app.codecov.io/gh/apache/dubbo/pull/16518/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
</details>
[:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/dubbo/pull/16518?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
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: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org