plugins/inputs/statsd: enforce minimum allowed_pending_messages

This commit is contained in:
Alex Russell-Saw 2016-10-10 11:02:29 +01:00
parent 4f06f6b3d8
commit 2fe3e7f1c8
2 changed files with 6 additions and 0 deletions

View File

@ -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

View File

@ -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 {