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

panic: division by zero in statsd allowed_pending_messages #1869

Closed
arussellsaw opened this issue Oct 10, 2016 · 5 comments
Closed

panic: division by zero in statsd allowed_pending_messages #1869

arussellsaw opened this issue Oct 10, 2016 · 5 comments

Comments

@arussellsaw
Copy link

Bug report

panic on statsd input where allowed_pending_messages < 1

minimal PR, looking for quick wins for hacktoberfest 😸

found via a tweet from a pal: https://twitter.com/rubynerd/status/775399499128856576

Relevant telegraf.conf:

[[inputs.statsd]]
  allowed_pending_messages = 0

System info:

telegraf 1.0, MacOS 10.10

Steps to reproduce:

  1. setup statsd input with 0 allowed_pending_messages
  2. get input to start dropping messages

Expected behavior:

no panics, either automatically adjusting value or quitting cleanly with error message

Actual behavior:

a panic of division by zero

Proposal:

Current behavior:

panic when dropping messages

Desired behavior:

adjust pending messages to at least 1, warn the user

@sparrc
Copy link
Contributor

sparrc commented Oct 10, 2016

TFW users tweet about issues rather than opening bug reports.....

it's already fixed in 1.0.1: #1785

@sparrc sparrc closed this as completed Oct 10, 2016
@arussellsaw
Copy link
Author

oh no! i thought i'd gotten here in time for hacktoberfest.

@sparrc
Copy link
Contributor

sparrc commented Oct 10, 2016

sorry mate, appreciate the effort though :), now that I think about it I think it could still panic if a user actively set the value to 0....maybe there is still a bug?

the PR I linked to just fixed it so that not setting a value wouldn't default to 0

@sparrc sparrc reopened this Oct 10, 2016
@arussellsaw
Copy link
Author

i have a PR ready with a warn and adjust to 1 if that's the desired behaviour

@arussellsaw
Copy link
Author

#1870

@sparrc sparrc closed this as completed Oct 10, 2016
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

No branches or pull requests

2 participants