Just stumbled on a pretty bad bug. We have an async application. And unfortunately, the DNS resolution in one place was done synchronously by to_socket_addrs.
It all worked well when DNS was resolved fast, and it started to exhibit very unpleasant behavior when DNS began to act up.
BTW. The documentation is quite clear: "Note that this function may block the current thread while resolution is performed.". However, it took a while to figure out what was going on.
I am worried that
- It's too easy to introduce in another place a call to_socket_addrs
- There could be other sync network calls that I should be aware of.
So, the question is. Do you know any tools or configurations to check for things like that? (My guess is I am not the first "lucky" person to stumble on these problems).