[Bug] Rocketmq namesrv解析网卡v6地址存在问题
- Dominant language
- Java
- Stars
- 22.6k
- Forks
- 12k
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 26
Description
### Before Creating the Bug Report
- [x] I found a bug, not just asking a question, which should be created in [GitHub Discussions](https://github.com/apache/rocketmq/discussions).
- [x] I have searched the [GitHub Issues](https://github.com/apache/rocketmq/issues) and [GitHub Discussions](https://github.com/apache/rocketmq/discussions) of this repository and believe that this is not a duplicate.
- [x] I have confirmed that this bug belongs to the current repository, not other repositories of RocketMQ.
### Runtime platform environment
纯单栈v6环境启动运行namesrv
### RocketMQ version
5.1.3
### JDK Version
1.8
### Describe the Bug
v6环境部署namesrv组件。日志发现解析v6地址存在问题
### Steps to Reproduce
使用bin/mqnamesrv -c /root/rocketmq-5.1.3-1/conf/namesrv.conf启动namesrv组件。发现日志报错,类似v6地址解析异常。后续broker无法注册namesrv。
### What Did You Expect to See?
应该解析得到[202:202:0:0:0:0:81:1811]:9876 这样的地址。通过 ping6 202:202:0:0:0:0:81:1811和 nc -vz -6 202:202:0:0:0:0:81:1811 9876都可以连通。
### What Did You See Instead?
createChannel: begin to connect remote host[[202:202:0:0:0:0:81:1811%enp1s0]:9876]
java.net.UnknownHostException: [202: invalid IPv6 address literal
### Additional Context
no
Contributor guide
Research direction
Reproduce the issue in a single-stack IPv6 environment by starting namesrv with bin/mqnamesrv -c /root/rocketmq-5.1.3-1/conf/namesrv.conf. Inspect the namesrv address parsing and connection path around the reported UnknownHostException and interface suffix. Done means namesrv uses a valid IPv6 address and the broker can register successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100