From 2fe3e7f1c8256223990254e4ddf7dff85eae1c3b Mon Sep 17 00:00:00 2001 From: Alex Russell-Saw Date: Mon, 10 Oct 2016 11:02:29 +0100 Subject: [PATCH] plugins/inputs/statsd: enforce minimum allowed_pending_messages --- CHANGELOG.md | 1 + plugins/inputs/statsd/statsd.go | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 93162e67e..d2effa668 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,6 +38,7 @@ continue sending logs to /var/log/telegraf/telegraf.log. ### Bugfixes +- [#1870](https://github.com/influxdata/telegraf/pull/1870): plugins/inputs/statsd: enforce minimum allowed_pending_messages - [#1746](https://github.com/influxdata/telegraf/issues/1746): Fix handling of non-string values for JSON keys listed in tag_keys. - [#1628](https://github.com/influxdata/telegraf/issues/1628): Fix mongodb input panic on version 2.2. - [#1733](https://github.com/influxdata/telegraf/issues/1733): Fix statsd scientific notation parsing diff --git a/plugins/inputs/statsd/statsd.go b/plugins/inputs/statsd/statsd.go index a46af0a87..55f344dc8 100644 --- a/plugins/inputs/statsd/statsd.go +++ b/plugins/inputs/statsd/statsd.go @@ -236,6 +236,11 @@ func (s *Statsd) Gather(acc telegraf.Accumulator) error { func (s *Statsd) Start(_ telegraf.Accumulator) error { // Make data structures s.done = make(chan struct{}) + + if s.AllowedPendingMessages < 1 { + log.Printf("I! statsd: allowed_pending_messages < 1 not allowed (%v) set to 1", s.AllowedPendingMessages) + s.AllowedPendingMessages = 1 + } s.in = make(chan []byte, s.AllowedPendingMessages) if prevInstance == nil {