HDDS-15599. Follow up clean up from HDDS-15531 PR 10486#10538
Merged
Conversation
Addresses the post-merge review comments from @szetszwo on #10486. All three are minor, behavior-preserving changes he asked to be handled in a follow-up PR. - ConnectionFailureUtils: ConnectException and NoRouteToHostException both extend SocketException, so their explicit instanceof checks were redundant. Removed them (the SocketException branch still matches both) and added a comment. They remain listed in the class Javadoc as connection-failure shapes. - OzoneConfigKeys: moved ozone.client.failover.resolve-needed (key, default, and Javadoc) next to ozone.client.failover.max.attempts. - OMFailoverProxyProviderBase: replaced the synchronized null-guard in maybeRefreshCurrentOmAddress with Objects.requireNonNull for nodeId and info. getCurrentProxyOMNodeId() is already synchronized and omProxies is an unmodifiable map built once at construction, so neither read needs the provider monitor and both values are always present.
szetszwo
approved these changes
Jun 18, 2026
szetszwo
left a comment
Contributor
There was a problem hiding this comment.
+1 the change looks good.
Contributor
|
Thanks @kerneltime for the patch, @szetszwo for the review. |
Contributor
|
@kerneltime please push dev branches (e.g. |
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 changes were proposed in this pull request?
Post-merge cleanup addressing @szetszwo's review comments on #10486
(HDDS-15531). He left three minor comments after the merge and asked that
they be handled in a follow-up PR. All three are behavior-preserving.
ConnectionFailureUtils—ConnectExceptionandNoRouteToHostExceptionboth extendSocketException, so their explicitinstanceofchecks were redundant. Removed them (theSocketExceptionbranch still matches both) and added a comment. They remain listed in the
class Javadoc as connection-failure shapes.
(comment)
OzoneConfigKeys— movedozone.client.failover.resolve-needed(key, default, and Javadoc) next to
ozone.client.failover.max.attempts.(comment)
OMFailoverProxyProviderBase.maybeRefreshCurrentOmAddress— replacedthe
synchronizednull-guard withObjects.requireNonNullfornodeIdand
info.getCurrentProxyOMNodeId()is alreadysynchronizedandomProxiesis an unmodifiable map built once at construction, so neitherread needs the provider monitor and both values are always present.
(comment)
No functional changes: the connection-failure classification is identical
(the removed types still match via
SocketException), the config constant isunchanged, and
requireNonNullonly fast-fails on inputs that cannot occurrather than silently returning
false.What is the link to the Apache JIRA?
https://issues.apache.org/jira/browse/HDDS-15599
How was this patch tested?
No new tests — these are refactors covered by the existing suites:
TestConnectionFailureUtils:ConnectException/NoRouteToHostException(bare and cause-nested) remain classified as connection failures via the
SocketExceptionbranch.TestOMFailoverProxyProviderRefreshWiredandTestOMProxyInfoDnsRefresh:the refresh wiring is exercised through method overrides, so the internal
refactor of
maybeRefreshCurrentOmAddressdoes not change their behavior.mvn checkstyle:checkreports 0 violations on bothhadoop-hdds/commonandhadoop-ozone/common.