From d8f2d4af0fbe6592cd086ef876ff59822e70c2f9 Mon Sep 17 00:00:00 2001 From: Daniel Nelson Date: Sun, 25 Feb 2018 01:04:04 -0800 Subject: [PATCH] Disable keepalive in mqtt output. (#3779) This functionality currently has race conditions that can result in the output deadlocking. (cherry picked from commit 8c932abff64c7a905e58ab708502ebf54c52b6bd) --- plugins/outputs/mqtt/mqtt.go | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/outputs/mqtt/mqtt.go b/plugins/outputs/mqtt/mqtt.go index 05978aa60189f..3e2a36e9ec080 100644 --- a/plugins/outputs/mqtt/mqtt.go +++ b/plugins/outputs/mqtt/mqtt.go @@ -162,6 +162,7 @@ func (m *MQTT) publish(topic string, body []byte) error { func (m *MQTT) createOpts() (*paho.ClientOptions, error) { opts := paho.NewClientOptions() + opts.KeepAlive = 0 * time.Second if m.Timeout.Duration < time.Second { m.Timeout.Duration = 5 * time.Second