node-statsd
node-statsd copied to clipboard
Added thrown error when cacheDNS flag fails to resolve dns name
Hello! Some justification for this throw:
Currently if the user passes a hostname to options.host without the cache flag on, the module will try to resolve the DNS name during runtime when the user tries to use any statsd function. The issue here is that if the DNS server cannot be reached, the server will crash.
The cacheDns flag allows an elegant way to allow users to opt out of this behavior. As long as the DNS name was successfully resolved when the module is initialized, the module will not cause the application to crash if DNS is not reachable.
To further reinforce this behavior, I think the the cacheDns lookup should immediately throw if the user passes an invalid hostname during initialization.
This has been biting me, I assumed this would be the fix too. Any chance of this being merged any time soon? It's killing my 6 hour-ish long process over and over. I will just cache for now, didn't realise that was an option.
Excuse my intrusion here, but nothing has been merged in this project for a long time. I started https://github.com/brightcove/hot-shots because of this, which includes this change.
Ah, didn't realise this wasn't being maintained, thanks for the heads up, @bdeitte!