Skip to content

HDDS-16307. Construct listeners from separate host and port values - #11130

Draft
rjgoyln wants to merge 1 commit into
apache:masterfrom
rjgoyln:HDDS-16307
Draft

HDDS-16307. Construct listeners from separate host and port values#11130
rjgoyln wants to merge 1 commit into
apache:masterfrom
rjgoyln:HDDS-16307

Conversation

@rjgoyln

@rjgoyln rjgoyln commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

A bind-host property set to an IPv6 literal — including the wildcard :: — stops the service from starting. Ozone joins host and port by string concatenation before parsing the result, so :: and port 9860 become :::9860, which has no unambiguous host, and NetUtils.createSocketAddr rejects it with "Does not contain a valid host:port authority". The listener is never bound.

Every listener-construction site now combines through HddsUtils.getHostPortString, the bracket-aware helper added in HDDS-15768. That covers the SCM client, block, security and datanode endpoints and their SCM HA per-node equivalents, the datanode client RPC endpoint, the OM RPC and peer HTTP endpoints, and — through BaseHttpServer.getBindAddress — every HTTP and HTTPS listener in the project.

Three sites undid that fix further along the same code path by re-serializing an address that had already been built correctly: the Jetty endpoint URI, and the two places that write a server's real listen address back into configuration once it has bound. An unbracketed authority written there is read back as a bare host with the port silently dropped, so the endpoint cannot be recovered from configuration either. These used Hadoop's NetUtils.getHostPortString(InetSocketAddress), which does not bracket; a bracket-aware overload of the Ozone helper replaces it.

IPv4 and DNS behaviour is unchanged, since a host is bracketed only when it contains a colon, and no configuration property or bind default changes. Advertised-address validation stays with the second sub-task of HDDS-15778, along with the four remaining call sites that render advertised peer identities.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-16307

How was this patch tested?

New and extended unit tests in TestHddsUtils, TestHddsServerUtil, TestScmUtils, TestBaseHttpServer, TestServerUtils and TestOmUtils, each confirmed to fail without the production change. The existing IPv4 and DNS assertions in those classes are kept, so the unchanged defaults stay covered.

updateConnectorAddress has no dedicated test: asserting on it needs a server actually bound to ::, whose accepted address families depend on the operating system's IPV6_V6ONLY handling. That qualification belongs with the IPv6 test environment in HDDS-15779.

Generated-by: Claude Code (Opus 5)

Setting any bind-host property to an IPv6 literal, including the wildcard
::, stopped the service from starting. The host and port were joined by
string concatenation before being handed to NetUtils.createSocketAddr, and
a bare IPv6 literal followed by a plain colon and a port is ambiguous, so
parsing failed with "Does not contain a valid host:port authority".

The same concatenation ran again once a server had bound and its real
listen address was written back into configuration. That turned a correct
address into one whose port is silently dropped on the next read, leaving
the HTTP and RPC endpoints unrecoverable from configuration as well.

Generated-by: Claude Code (Opus 5)
Copilot AI lite review requested due to automatic review settings August 27, 2026 11:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

2 participants