kalayciburak opened a new pull request, #3291:
URL: https://github.com/apache/hugegraph/pull/3291
## Purpose of the PR
- close #3255
`IpUtil.getNearestAddress` treats a configured hostname as a dotted IPv4.
`Integer.parseInt` fails on the first DNS label and the catch logs that as
`getRaftAddress`, a method that does not exist. When the only collected address
is loopback, the single-address shortcut replaces the hostname with `127.0.0.1`.
## Main Changes
- Return a host that is not a dotted IPv4 literal unchanged, before listing
local addresses, so a hostname does not log an error.
- Skip loopback and link-local addresses when collecting local IPv4s, so
`127.0.0.1` is not chosen as the Store registration address.
- Name the failure log after `getNearestAddress`.
## Verifying these changes
- [x] Need tests and can be verified as follows:
- `JAVA_HOME=17 mvn test -pl hugegraph-store/hg-store-test -am -P
store-core-test -Dtest=IpUtilTest -Dsurefire.failIfNoSpecifiedTests=false`
- RED: `127.0.0.2:8510` was `127.0.0.1:8510`, and a hostname logged
ERROR.
- GREEN: `IpUtilTest` 2 run, 0 failed.
## Does this PR potentially affect the following parts?
- [x] Nope
## Documentation Status
- [x] `Doc - No Need`: no user-visible documentation is affected.
Documentation files in this PR or paired hugegraph-doc PR:
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]