8000 collectd-mod-mqtt - hangs after 20 (qos=1) messages are sent · Issue #2727 · collectd/collectd · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
collectd-mod-mqtt - hangs after 20 (qos=1) messages are sent #2727
Closed
@viulian

Description

@viulian
  • Version of collectd: 5.8.0-4
  • Operating system / distribution: LEDE snapshot (17.01)

Actual behavior

collectd-mod-mqtt plugin hangs when it has to publish more than 20 messages with QoS 1 (it hangs after the 20th). No other messages are being sent afterwards unless collectd is restarted. After a while, the broker will disconnect the client (5minutes I guess).

Steps to reproduce

  • configure collectd with some plugins that produce output (memory, df, load, interface, etc) where there should be more than 20 measurements taken.
  • configure collectd-mod-mqtt plugin to publish the messages to a broker
  • start collectd.

Only 20 messages get sent then everything gets stuck.

I've narrowed it down to mqtt.c file not calling mosquitto_loop() after the call to mosquitto_publish(). It means that the client (collectd-mod-mqtt) will quickly fill out its inflight buffer, since only misquitto_loop() consumes the PUBACK from the broker. By default, libmosquitto has an inflight limit of 20 message (qos 1 or 2) - and without the confirmation from the broker, it will refuse to send more.

I have a small patch ready, but I haven't tested with QoS 2 for now, nor with TLS.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0