Skip to content

Commit

Permalink
Disable keepalive in mqtt output. (#3779)
Browse files Browse the repository at this point in the history
This functionality currently has race conditions that can result in the
output deadlocking.

(cherry picked from commit 8c932ab)
  • Loading branch information
danielnelson committed Feb 25, 2018
1 parent d8dae1b commit d8f2d4a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions plugins/outputs/mqtt/mqtt.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d8f2d4a

Please sign in to comment.