pothosware / pothos-library

Framework library used by all Pothos projects
www.pothosware.com
4 stars 0 forks source link

RemoteClient DNS Cache #56

Closed guruofquality closed 10 years ago

guruofquality commented 10 years ago

DNS timeouts can make the interface sluggish. We should determine the result of a lookup and cache it to avoid nasty timeouts in the face of failure.

The RemoteClient interface relies on the timeout parameter to be obeyed. This is not correct when the lookup times out.

guruofquality commented 10 years ago

Most likely, the DNS timeout is not configurable. The code that performs the lookup should spawn an async future to resolve the host. If the future does not complete within the timeout, the host is considered offline.

Documentation for Poco DNS resolver: http://pocoproject.org/docs/Poco.Net.DNS.html The Poco DNS resolver has an internal cache, but seems to suffer from long timeouts. Therefore, we would probably need to async future a call to Poco::Net::DNS::resolveOne()...

Where to call into the cache: https://github.com/pothosware/pothos-library/blob/master/lib/Remote/Client.cpp#L64

guruofquality commented 10 years ago

Update: Poco::Net::SocketAddress also performs the DNS resolution, but handles IPv4 vs IPv6. Replace Poco::Net::DNS::resolveOne() with SocketAddress for resolution.

guruofquality commented 10 years ago

https://github.com/pothosware/pothos/commit/ae22d56eebf867f519f23bc46ef1e7e19a212ff0