Read triple max-message-size from the global configuration by CCCLL · Pull Request #16518 · apache/dubbo · GitHub
Skip to content

Read triple max-message-size from the global configuration - #16518

Open
CCCLL wants to merge 1 commit into
apache:3.3from
CCCLL:triple-max-message-size-config
Open

CCCLL wants to merge 1 commit into
apache:3.3from
CCCLL:triple-max-message-size-config

Conversation

@CCCLL

@CCCLL CCCLL commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

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

  • Make sure there is a GitHub_issue field for the change.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • 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 project.
  • Make sure gitHub actions can pass. Why the workflow is failing and how to fix it?

LengthFieldStreamingDecoder, Gzip and Bzip2 read
dubbo.protocol.triple.max-message-size through
ConfigurationUtils.getEnvConfiguration, which only looks at OS
environment variables. A limit set as a system property, in
dubbo.properties or in Spring Boot properties was ignored.

Read it through ConfigurationUtils.getGlobalConfiguration instead, like
the other dubbo.protocol.triple.* keys that are read without a URL.
Applications that already set the key in one of these sources now get
that limit instead of the 50 MB default. Environment variables keep
working; a system property now takes precedence over an environment
variable, as in the global configuration.

Fixes apache#16517
@codecov-commenter

codecov-commenter commented Oct 19, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 60.90%. Comparing base (ae809de) to head (9b46f0c).
⚠️ Report is 1 commits behind head on 3.3.

Additional details and impacted files
@@             Coverage Diff              @@
##                3.3   #16518      +/-   ##
============================================
- Coverage     60.92%   60.90%   -0.02%     
  Complexity       15       15              
============================================
  Files          1953     1953              
  Lines         89278    89278              
  Branches      13476    13475       -1     
============================================
- Hits          54390    54379      -11     
- Misses        29313    29317       +4     
- Partials       5575     5582       +7     
Flag Coverage Δ
integration-tests-java21 32.13% <33.33%> (+0.06%) ⬆️
integration-tests-java8 32.20% <33.33%> (-0.11%) ⬇️
samples-tests-java21 32.12% <66.66%> (+0.02%) ⬆️
samples-tests-java8 29.78% <66.66%> (-0.02%) ⬇️
unit-tests-java11 59.17% <100.00%> (+<0.01%) ⬆️
unit-tests-java17 58.62% <100.00%> (-0.07%) ⬇️
unit-tests-java21 58.68% <100.00%> (+0.01%) ⬆️
unit-tests-java25 58.64% <100.00%> (+0.03%) ⬆️
unit-tests-java8 59.17% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] dubbo.protocol.triple.max-message-size is only read from OS environment variables

2 participants