Skip to content

DNS resolution perma-cached #36

@SpencerMalone

Description

@SpencerMalone

The recent(ish) release of https://github.com/logstash-plugins/logstash-output-statsd to 3.2.0 used the latest release of https://github.com/reinh/statsd/blob/master/lib/statsd.rb, which changed the socket logic to reuse a single socket until error (https://github.com/reinh/statsd/blob/master/lib/statsd.rb#L438). This works fine for TCP, but for UDP if a host name changes (like it might in a k8s-like environment), we will never refresh the socket and start losing stats. I'm sort of assuming the upstream won't get fixed based on the issues that exist in their github (calls for a maintainer, etc.)

I confirmed this by testing SpencerMalone@5130f96 1, but am unsure of how to proceed for an upstream fix. My current solution is hacky at best. I don't really recall ruby's concurrency semantics, is it a whole new process? Can we call connect from a child thread created in the register function? Anyone have opinions on how to best approach this?

This is a copy of the issue @ https://discuss.elastic.co/t/logstash-statsd-plugin-caches-dns-resolutions-when-using-udp-forever/170413, which was created as recommended by https://github.com/logstash-plugins/logstash-output-statsd/blob/master/.github/ISSUE_TEMPLATE.md, but there was no interaction and the thread was closed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions