Some BookKeeper tests occasionally fail due to long delays in reverse DNS lookups. The root cause is the use of InitialDirContext.getAttributes() in org.apache.bookkeeper.net.DNS#reverseDns, which can block for up to 120 seconds if DNS resolution hangs. This leads to flaky or timing-out tests such as:
To improve reliability, we should replace the current blocking implementation with Netty's asynchronous DNS resolver. This will allow us to set timeouts, avoid blocking test threads, and reduce flakiness.
Test with Netty DNS:
