{{ message }}
Repository navigation
Conversation
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 Report✅ All modified and coverable lines are covered by tests. 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 Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

What is the purpose of the change?
Fixes #16517.
dubbo.protocol.triple.max-message-size(added in #15781) is read byLengthFieldStreamingDecoder,GzipandBzip2throughConfigurationUtils.getEnvConfiguration(...), which only looks at OS environment variables. Setting the limit as a system property, indubbo.propertiesor 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 otherdubbo.protocol.triple.*keys that are read without a URL already do (rest.json-frameworkinHttpJsonUtils,rest.disallowed-content-typesinCodecUtils,verbose,rest.enabledandrest.openapi.enabledinTripleProtocol). The global configuration covers system properties, environment variables, the config center, Spring Boot properties (copied in byDubboContextPostProcessor) anddubbo.properties.Behavior change
dubbo.protocol.triple.max-message-sizeas a system property, indubbo.propertiesor 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 withMessage 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.Not covered
A limit set only programmatically through
TripleConfig#setMaxMessageSizeis 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
LengthFieldStreamingDecoderTest#honorsMaxMessageSizeFromSystemPropertyLengthFieldStreamingDecoderTest#honorsMaxMessageSizeFromApplicationProperties(sets the key in the application configuration, where Spring Boot properties are copied to)GzipTest#decompressionHonorsConfiguredMaxMessageSizeandBzip2Test#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.-Dsystem propertydubbo.propertiesapplication.propertiesRejected calls fail with
Message size 4130 exceeds limit 1024.Checklist