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

Address already in use with webhooks input during reload #3136

Closed
danielnelson opened this issue Aug 18, 2017 · 2 comments
Closed

Address already in use with webhooks input during reload #3136

danielnelson opened this issue Aug 18, 2017 · 2 comments
Labels
bug unexpected problem or unintended behavior
Milestone

Comments

@danielnelson
Copy link
Contributor

Bug report

If you send Telegraf a SIGHUP when using the webhooks input, an error is emitted. Most likely the webhook server is not restarted.

Relevant telegraf.conf:

[[inputs.webhooks]]
  service_address = ":1619"
  [inputs.webhooks.github]
    path = "/github"

System info:

Telegraf v1.5.0~pre3006ccbf (git: master 3006ccb)

Steps to reproduce:

  1. Start Telegraf with webhooks input
  2. pkill -HUP telegraf

Expected behavior:

Webhooks server restarted

Actual behavior:

2017-08-18T01:45:44Z E! Error in plugin [inputs.webhooks]: E! Error starting server: listen tcp :1619: bind: address already in use
@danielnelson danielnelson added area/webhook bug unexpected problem or unintended behavior labels Aug 18, 2017
@dsalbert
Copy link
Contributor

dsalbert commented Sep 7, 2017

Hi @danielnelson,

I've redesigned this plugin, based on zipkin http listener. The key part is to avoid printing error message in situation where http.ErrServerClosed occur. Please take a look -
#3206

Output after sending 2 HUP signals:

2017-09-07T13:24:58Z I! Starting Telegraf v1.5.0~preebfd822
2017-09-07T13:24:58Z I! Loaded outputs: file
2017-09-07T13:24:58Z I! Loaded inputs: inputs.webhooks
2017-09-07T13:24:58Z I! Tags enabled: host=dankan-ThinkPad-T440s
2017-09-07T13:24:58Z I! Agent Config: Interval:5s, Quiet:false, Hostname:"dankan-ThinkPad-T440s", Flush Interval:10s
2017-09-07T13:24:58Z I! Started the webhooks_github on /github
2017-09-07T13:24:58Z I! Started the webhooks service on :1619
2017-09-07T13:25:03Z I! Reloading Telegraf config
2017-09-07T13:25:03Z I! Hang on, flushing any cached metrics before shutdown
2017-09-07T13:25:03Z I! Stopping the Webhooks service
2017-09-07T13:25:03Z I! Starting Telegraf v1.5.0~preebfd822
2017-09-07T13:25:03Z I! Loaded outputs: file
2017-09-07T13:25:03Z I! Loaded inputs: inputs.webhooks
2017-09-07T13:25:03Z I! Tags enabled: host=dankan-ThinkPad-T440s
2017-09-07T13:25:03Z I! Agent Config: Interval:5s, Quiet:false, Hostname:"dankan-ThinkPad-T440s", Flush Interval:10s
2017-09-07T13:25:03Z I! Started the webhooks_github on /github
2017-09-07T13:25:03Z I! Started the webhooks service on :1619
2017-09-07T13:25:09Z I! Reloading Telegraf config
2017-09-07T13:25:09Z I! Hang on, flushing any cached metrics before shutdown
2017-09-07T13:25:09Z I! Stopping the Webhooks service
2017-09-07T13:25:09Z I! Starting Telegraf v1.5.0~preebfd822
2017-09-07T13:25:09Z I! Loaded outputs: file
2017-09-07T13:25:09Z I! Loaded inputs: inputs.webhooks
2017-09-07T13:25:09Z I! Tags enabled: host=dankan-ThinkPad-T440s
2017-09-07T13:25:09Z I! Agent Config: Interval:5s, Quiet:false, Hostname:"dankan-ThinkPad-T440s", Flush Interval:10s
2017-09-07T13:25:09Z I! Started the webhooks_github on /github
2017-09-07T13:25:09Z I! Started the webhooks service on :1619

Thanks,
Daniel

@dsalbert
Copy link
Contributor

Solved by #3206

@danielnelson danielnelson added this to the 1.5.0 milestone Sep 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

2 participants