bookkeeper
bookkeeper copied to clipboard
Fix getHosts by ip
Motivation
-
The PTR result will end with a
., we need to trim that, please see https://datatracker.ietf.org/doc/html/rfc1035#autoid-37 -
In testing, we use the loopback net interface, which doesn't need to do PTR parse by DNS:
java.lang.RuntimeException: java.net.UnknownHostException: Unable to resolve default hostname: 1.0.0.127.in-addr.arpa. for interface: lo0
at org.apache.bookkeeper.proto.SimpleBookieServiceInfoProvider.<init>(SimpleBookieServiceInfoProvider.java:41)
at org.apache.bookkeeper.bookie.TestBookieImpl.<init>(TestBookieImpl.java:71)
at org.apache.bookkeeper.bookie.TestBookieImpl.<init>(TestBookieImpl.java:46)
at org.apache.bookkeeper.bookie.BookieWriteToJournalTest.testForceLedger(BookieWriteToJournalTest.java:167)
Changes
- Trim the PTR result.
- Skip PTR parsing of loopback address by DNS.
We has been config like that:
bash-5.0$ cat conf/bk_server.conf |grep -i listen
listeningInterface=eth0
Alternative approach: #4588