bookkeeper icon indicating copy to clipboard operation
bookkeeper copied to clipboard

Fix getHosts by ip

Open nodece opened this issue 2 years ago • 1 comments

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.

nodece avatar Feb 21 '24 06:02 nodece

We has been config like that:

bash-5.0$ cat conf/bk_server.conf |grep -i listen
listeningInterface=eth0

hezhangjian avatar Jul 04 '24 11:07 hezhangjian

Alternative approach: #4588

nodece avatar Apr 22 '25 03:04 nodece