HDFS-17944. Validate short-circuit streams cache size - #8644
Open
johntomcat7408-cmyk wants to merge 1 commit into
Open
HDFS-17944. Validate short-circuit streams cache size#8644johntomcat7408-cmyk wants to merge 1 commit into
johntomcat7408-cmyk wants to merge 1 commit into
Conversation
Reject negative streams cache sizes while building DfsClientConf so invalid values do not leak the internal maxTotalSize diagnostic or depend on ClientContext reuse. Preserve zero as a valid value and cover both boundaries in the client module.
|
🎊 +1 overall
This message was automatically generated. |
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.
Description of PR
JIRA: HDFS-17944
dfs.client.read.shortcircuit.streams.cache.size=-1currently passesDfsClientConfparsing and is rejected only when a newShortCircuitCacheis built. This exposes the internalmaxTotalSizeparameter in the error, while reuse of an existing
ClientContextcanavoid that late validation entirely.
This PR:
building
DfsClientConf;-1boundary and the valid0boundary.
Zero remains valid and keeps its existing cache-retention semantics. The
change does not modify public APIs, protocols, dependencies,
hdfs-default.xml, or the defensive validation inShortCircuitCache.Source and attribution: the issue comes from HDFS-17944. The implementation
was independently written against the current
trunk. Its error style isconsistent with merged HDFS-17943 / PR #8603,
and the existing zero boundary was confirmed from merged
HDFS-16653 / PR #5568.
Open PR #7215 also touches
DfsClientConf.java, but only for lease renewal configuration; no code ortext from that unmerged PR was reused.
How was this patch tested?
On Windows x86_64 with JDK 21.0.11 and the repository Maven Wrapper:
Result:
BUILD SUCCESS; 10 reactor modules succeeded; 2 tests ran with0 failures, 0 errors, and 0 skips.
Result:
BUILD SUCCESS; 12 reactor modules succeeded; 1 test ran with0 failures, 0 errors, and 0 skips. Bash tests were skipped because
batswas not installed; the targeted Java test completed successfully.
Result: exit code 0. The new test has no Checkstyle violations.
DfsClientConf.javaretains a pre-existingMethodLengthwarning at line171; the production change is at line 844 and introduces no new violation.
A full repository build was not run.
For code changes:
AI Tooling