[
https://issues.apache.org/jira/browse/HADOOP-20030?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18133263#comment-18133263
]
ASF GitHub Bot commented on HADOOP-20030:
-----------------------------------------
smengcl opened a new pull request, #8879:
URL: https://github.com/apache/hadoop/pull/8879
Generated-by: Claude Code (Opus 5.5)
JIRA: https://issues.apache.org/jira/browse/HADOOP-20030
### Description of PR
The default surefire configuration sets `java.net.preferIPv4Stack=true`, so
test JVMs cannot use IPv6 and nothing in CI runs servers or clients over IPv6.
For example, `TestMiniDFSCluster#testBindHostIPv6Loopback` (HDFS-17998) is
always skipped.
This change:
- Adds an opt-in `ipv6-test` profile in `hadoop-project/pom.xml` that sets
`java.net.preferIPv4Stack=false` and `java.net.preferIPv6Addresses=true` for
surefire. Other surefire system properties are kept, and the default build is
unchanged.
- Adds `.github/workflows/ipv6.yml`, which builds `hadoop-common`,
`hadoop-hdfs-client` and `hadoop-hdfs` and runs a selected list of tests under
the profile. It runs on `pull_request` (filtered to those modules,
`hadoop-project/pom.xml` and the workflow itself) and on `workflow_dispatch`,
with read-only permissions. It needs only the IPv6 loopback address, so hosted
runners work.
The list only has tests that pass on an IPv6 preferring JVM. Running more of
the IPv6 related tests under the profile showed two existing gaps, which are
left for follow-ups:
- Most `MiniDFSCluster` based tests (for example `TestWebHdfsDataLocality`,
`TestSaslDataTransfer`) fail. `localhost` resolves to `::1`, so DataNodes
register with the NameNode as `[::1]`, but their transfer port binds to
`127.0.0.1` by default, and clients get "Connection refused".
- Some `TestNetUtils` and `TestSecurityUtil` cases expect `localhost` to
resolve to `127.0.0.1`.
The docker compose smoke test mentioned in the JIRA as optional is not
included.
### How was this patch tested?
Locally on macOS with JDK 17:
- `TestMiniDFSCluster#testBindHostIPv6Loopback` is skipped without the
profile and runs and passes with `-Pipv6-test`.
- The workflow's Test step command passes for the whole list (10 classes).
- With the same Maven arguments, a test that fails under IPv6
(`TestNetUtils#testResolverLoopback`) fails the build. The workflow needs
`-Dmaven.test.failure.ignore=false` because `hadoop-project/pom.xml` defaults
it to true.
The workflow runs on this PR.
### For code changes:
- [x] Does the title or this PR starts with the corresponding JIRA issue id
(e.g. 'HADOOP-17799. Your PR title ...')?
- [ ] Object storage: have the integration tests been executed and the
endpoint declared according to the connector-specific documentation?
- [ ] If adding new dependencies to the code, are these dependencies
licensed in a way that is compatible for inclusion under [ASF
2.0](http://www.apache.org/legal/resolved.html#category-a)?
- [ ] If applicable, have you updated the `LICENSE`, `LICENSE-binary`,
`NOTICE-binary` files?
🤖 Generated with [Claude Code](https://claude.com/claude-code)
> Add an opt-in Maven profile and CI job that run tests with IPv6 enabled
> -----------------------------------------------------------------------
>
> Key: HADOOP-20030
> URL: https://issues.apache.org/jira/browse/HADOOP-20030
> Project: Hadoop Common
> Issue Type: Sub-task
> Reporter: Siyao Meng
> Assignee: Siyao Meng
> Priority: Major
> Labels: ipv6
>
> The default surefire configuration sets {{java.net.preferIPv4Stack=true}} for
> every test JVM:
> {code:xml}
> <java.net.preferIPv4Stack>true</java.net.preferIPv4Stack>
> {code}
> [hadoop-project/pom.xml:2624|https://github.com/apache/hadoop/blob/1097744bc490b65cad5ab2fbeafff35687971357/hadoop-project/pom.xml#L2624]
> With that setting the JVM uses IPv4-only sockets, so tests cannot exercise
> IPv6 code paths even on a host with IPv6 loopback. There is also no CI job
> for IPv6. The IPv6 fixes under HADOOP-11890 therefore have unit tests for
> parsing and formatting, but nothing runs servers or clients over IPv6 in CI.
> *Proposal:*
> * Add an opt-in {{ipv6-test}} Maven profile that sets
> {{java.net.preferIPv4Stack=false}} and {{java.net.preferIPv6Addresses=true}}
> for surefire. The default build is unchanged.
> * Add a GitHub Actions workflow that runs a selected set of IPv6 tests under
> that profile. IPv6 loopback ({{::1}}) is available on hosted runners without
> outbound IPv6.
> * Optionally, a manually triggered job that builds the distribution and runs
> a small IPv6-only docker-compose cluster smoke test.
> Changing the default to dual-stack for all tests is a separate decision and
> is not proposed here.
> POC:
> https://github.com/smengcl/hadoop/commit/3aa86b3ccdebf594d7661786c22ce54e2c6baad1
> (profile) and
> https://github.com/smengcl/hadoop/commit/f0ed93b0eac18e19e391e2a6812b0f343ec0e20d
> (workflow)
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]