Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[core][dogstatsd] Added support for IP agnostic connections #2619

Merged
merged 3 commits into from Jul 5, 2016

Conversation

masci
Copy link
Contributor

@masci masci commented Jun 23, 2016

Why

Dogstatsd only listens to IPv4 connections, thus IPv6 clients aren't able to connect.

What

Now dogstatsd listens to an IP agnostic socket connection. IPv4 addresses are mapped to IPv6 to keep configuration file compatible with older versions.

While at the job: fixed tests, added tests and fixed PEP8 where possible.

@masci masci force-pushed the massi/dogstatsd_ipv6 branch 2 times, most recently from e066091 to 30392eb Compare June 23, 2016 14:07
@degemer degemer added this to the 5.9.0 milestone Jun 23, 2016
Map the host to an IPv6 address, trying to resolve the name
"""
try:
addr = socket.gethostbyname(host)
Copy link
Member

@truthbk truthbk Jun 24, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the general case you'll be converting the ipv4 to ipv6 anyways - but maybe we should favor the ipv6 record if it exists. I'm saying this because the DNS might have the same name resolve to an A (ipv4) and an AAAA (ipv6) record, or furthermore just an ipv6 record.... So getaddrinfo might be a better option for dual-stack resolution - otherwise if the hostname only has an ipv6 record this might fail.

@truthbk
Copy link
Member

truthbk commented Jun 24, 2016

In general it looks good, just a couple open questions, and the DNS issue.

Thanks a lot for splitting the tests, much, much cleaner and clear! 😍

@truthbk
Copy link
Member

truthbk commented Jul 5, 2016

This looks good! Good job 👍

@masci masci merged commit 6458638 into master Jul 5, 2016
@masci masci deleted the massi/dogstatsd_ipv6 branch July 5, 2016 15:52
truthbk pushed a commit that referenced this pull request Aug 10, 2016
* added support for IP agnostic dogstatsd

* give precedence to IPv4

* updated docs [skip ci]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants