8000 Add ReconnectInterval option to Network plugin by johnf · Pull Request #732 · collectd/collectd · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add ReconnectInterval option to Network plugin #732

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

Merged
merged 2 commits into from
Sep 14, 2014
Merged

Add ReconnectInterval option to Network plugin #732

merged 2 commits into from
Sep 14, 2014

Conversation

johnf
Copy link
Contributor
@johnf johnf commented Sep 13, 2014

The Network plugin only performs DNS resolution at initialization. This
can be problematic when trying to performs migrations of collectd
infrastructure or when trying to create HA solutions which are dependant
on DNS.

The ReconnectInterval options forces a reconnect of all the sockets at
the defined number of seconds. By default no re-connections are attempted
if this option is not set.

@auxesis
Copy link
auxesis commented Sep 13, 2014

👍

@lusis
Copy link
lusis commented Sep 13, 2014

definitely awesome! 💯

@mfournier
Copy link

Thanks for your patch!

The issue it solves seems similar to #627 which got fixed by 61adba6 very recently.

I'm wondering: does this issue also happen when using current master branch? Or did you only hit this problem when using a released version of collectd?

@johnf
Copy link
Contributor Author
johnf commented Sep 14, 2014

I believe #627 solves a different problem.

#627 is trying to solve for the underlying network socket not being valid any more. For example

  • collectd starts before network exists (no IP on the interface yet)
  • The IP on the interface changes

So it is trying to solve for changing source address. It does this by detecting the sendto failed and then disconnecting the socket.

My patch is doing the opposite. It is trying to solve for the destination address changing. Basically if someone updated DNS so collectd.example.com points somewhere else.

So they are complimentary I would say.

@octo octo self-assigned this Sep 14, 2014
@octo
Copy link
Member
octo commented Sep 14, 2014

Hi @johnf, thank you very much for your patch! I have two change requests and a nit ;-)

  • use cf_until_get_time() from configfile.h for parsing the config option.
  • the name of the option is a bit misleading: if there was a connection we wouldn't have the problem. How do you feel about "ResolveInterval"?

Nit: use a _Bool for the reconnect variable.

Thanks again and best regards :-)
--octo

The Network plugin only performs DNS resolution at initialization. This
can be problematic when trying to performs migrations of collectd
infrastructure or when trying to create HA solutions which are dependant
on DNS.

The ReconnectInterval options forces a reconnect of all the sockets at
the defined number of seconds. By default no re-connections are attempted
if this option is not set.
@johnf
Copy link
Contributor Author
johnf commented Sep 14, 2014

@octo Thanks for the review. I've updated with your changes and rebased against master again. Let me know if you want any other changes.

@octo octo merged commit 4a89ba5 into collectd:master Sep 14, 2014
@octo
Copy link
Member
octo commented Sep 14, 2014

Thanks @johnf!

henrysher pushed a commit to henrysher/fedora-infra-ansible that referenced this pull request May 26, 2015
see: collectd/collectd#732

Signed-off-by: Ricky Elrod <codeblock@fedoraproject.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
0