Skip to content
This repository has been archived by the owner on Sep 19, 2024. It is now read-only.

Added thrown error when cacheDNS flag fails to resolve dns name #57

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ainsleyc
Copy link

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.

@Olical
Copy link

Olical commented Jun 13, 2016

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.

@bdeitte
Copy link

bdeitte commented Jun 13, 2016

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.

@Olical
Copy link

Olical commented Jun 13, 2016

Ah, didn't realise this wasn't being maintained, thanks for the heads up, @bdeitte!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants